aboutsummaryrefslogtreecommitdiffstats
path: root/audio/streamtuner
diff options
context:
space:
mode:
authorjylefort <jylefort@FreeBSD.org>2005-05-11 09:59:38 +0800
committerjylefort <jylefort@FreeBSD.org>2005-05-11 09:59:38 +0800
commita1e3116da924a046dde6a0670d0031a7ac3511b8 (patch)
tree5fdbec9ac0481618a4bcdc1f3f0d430e37a14784 /audio/streamtuner
parentb84187700a41124d5cc05b4dba78eb604a08a80d (diff)
downloadfreebsd-ports-gnome-a1e3116da924a046dde6a0670d0031a7ac3511b8.tar.gz
freebsd-ports-gnome-a1e3116da924a046dde6a0670d0031a7ac3511b8.tar.zst
freebsd-ports-gnome-a1e3116da924a046dde6a0670d0031a7ac3511b8.zip
Fix Live365 support.
Diffstat (limited to 'audio/streamtuner')
-rw-r--r--audio/streamtuner/Makefile2
-rw-r--r--audio/streamtuner/files/patch-src_plugins_live365_live365.c247
2 files changed, 248 insertions, 1 deletions
diff --git a/audio/streamtuner/Makefile b/audio/streamtuner/Makefile
index d80d7873587e..ebd41f6e79d3 100644
--- a/audio/streamtuner/Makefile
+++ b/audio/streamtuner/Makefile
@@ -7,7 +7,7 @@
PORTNAME= streamtuner
PORTVERSION= 0.99.99
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= audio www
MASTER_SITES= ${MASTER_SITE_SAVANNAH}
MASTER_SITE_SUBDIR= ${PORTNAME}
diff --git a/audio/streamtuner/files/patch-src_plugins_live365_live365.c b/audio/streamtuner/files/patch-src_plugins_live365_live365.c
new file mode 100644
index 000000000000..2000c3b663b0
--- /dev/null
+++ b/audio/streamtuner/files/patch-src_plugins_live365_live365.c
@@ -0,0 +1,247 @@
+--- src/plugins/live365/live365.c.orig Wed May 11 03:49:30 2005
++++ src/plugins/live365/live365.c Wed May 11 03:51:11 2005
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2002, 2003, 2004 Jean-Yves Lefort
++ * Copyright (C) 2002-2005 Jean-Yves Lefort
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+@@ -59,7 +59,9 @@
+ {
+ ACCESS_ALL,
+ ACCESS_VIP,
+- ACCESS_SUBSCRIPTION
++ ACCESS_SUBSCRIPTION,
++ ACCESS_SOLD_OUT,
++ ACCESS_UNKNOWN
+ } Access;
+
+ typedef struct
+@@ -94,7 +96,8 @@
+ {
+ GList **streams;
+ Live365Stream *stream;
+- Live365Stream *finished_stream;
++ gboolean first_page;
++ gboolean looped;
+ gboolean has_next_page;
+ } ReloadStreamsInfo;
+
+@@ -263,13 +266,16 @@
+
+ case FIELD_ACCESS_STRING:
+ {
+- const char *str = NULL;
++ const char *str;
+
+ switch (stream->access)
+ {
+ case ACCESS_ALL: str = _("All"); break;
+ case ACCESS_VIP: str = _("VIP"); break;
+ case ACCESS_SUBSCRIPTION: str = _("Subscription"); break;
++ case ACCESS_SOLD_OUT: str = _("Sold out"); break;
++ case ACCESS_UNKNOWN: str = _("Unknown"); break;
++ default: str = NULL; break;
+ }
+
+ g_value_set_string(value, str);
+@@ -707,14 +713,16 @@
+ char *s1, *s2, *s3, *s4, *s5;
+
+ if ((s1 = st_strstr_span(line, "<a href=\"/cgi-bin/directory"))
+- && (s2 = st_strstr_span(s1, "&genre="))
++ && (s2 = st_strstr_span(s1, "genre="))
+ && (s3 = strchr(s2, '"'))
+ && (s4 = st_strchr_span(s3, '>'))
+ && (s5 = strstr(s4, "</a>")))
+ {
+ category = st_category_new();
+ category->name = g_strndup(s2, s3 - s2);
+- category->label = st_sgml_ref_expand_len(s4, s5 - s4);
++ category->label = ! strcmp(category->name, "Recommendations")
++ ? g_strdup(_("Recommendations"))
++ : st_sgml_ref_expand_len(s4, s5 - s4);
+ category->url_postfix = g_strconcat(DIRECTORY_PREFIX, category->name, NULL);
+ }
+ else if ((s1 = st_strstr_span(line, "<a href=\"/genres/"))
+@@ -755,6 +763,8 @@
+
+ *streams = NULL;
+ info.streams = streams;
++ info.first_page = TRUE;
++ info.looped = FALSE;
+
+ session = st_transfer_session_new();
+
+@@ -802,9 +812,11 @@
+ if (status) /* only display warning if the transfer was otherwise correct */
+ PARSE_ERROR;
+ }
++
++ info.first_page = FALSE;
+ }
+- while (status && info.has_next_page
+- && (stream_limit == -1 || received_streams < stream_limit));
++ while (status && info.has_next_page && ! info.looped
++ && (stream_limit == -1 || received_streams < stream_limit));
+
+ st_transfer_session_free(session);
+
+@@ -818,6 +830,10 @@
+ char *s1, *s2, *s3, *s4, *s5, *s6, *s7;
+ char *word1, *word2, *word3;
+
++ /* if we have detected a loop, we just ignore the page */
++ if (info->looped)
++ return;
++
+ if ((s1 = st_str_has_prefix_span(line, "<TD CLASS=\"icon\""))
+ && (s2 = st_strstr_span(s1, "DrawPlayIcon")))
+ {
+@@ -834,15 +850,18 @@
+ info->stream->access = ACCESS_VIP;
+ else if (strstr(s2, "'SUBSCRIPTION'"))
+ info->stream->access = ACCESS_SUBSCRIPTION;
++ else if (strstr(s2, "'SOLD_OUT'"))
++ info->stream->access = ACCESS_SOLD_OUT;
+ else
+- PARSE_ERROR;
+-
+- info->finished_stream = NULL;
++ {
++ PARSE_ERROR;
++ info->stream->access = ACCESS_UNKNOWN;
++ }
+ }
+ else if ((s1 = st_str_has_prefix_span(line, "<TD CLASS=\"title"))
+- && (s2 = st_strstr_span(s1, "href='"))
+- && (s3 = strstr(s2, "'>"))
+- && (s4 = strstr(s3, "</a>")))
++ && (s2 = st_strstr_span(s1, "href='"))
++ && (s3 = strstr(s2, "'>"))
++ && (s4 = strstr(s3, "</a>")))
+ {
+ if (info->stream)
+ {
+@@ -865,12 +884,19 @@
+ else
+ PARSE_ERROR;
+ }
+- else if ((s1 = st_strstr_span(line, "&station_id="))
+- && (s2 = strchr(s1, '&')))
++ else if ((s1 = st_str_has_prefix_span(line, "<TD CLASS=\"handle\""))
++ && (s2 = st_strstr_span(s1, "ReadCookie("))
++ && (s3 = st_strstr_span(s2, ", '"))
++ && (s4 = strchr(s3, '\''))
++ && (s5 = st_strstr_span(s4, "&station_id="))
++ && (s6 = strchr(s5, '&')))
+ {
+ if (info->stream)
+ {
+- word1 = g_strndup(s1, s2 - s1);
++ g_free(info->stream->broadcaster);
++ info->stream->broadcaster = st_sgml_ref_expand_len(s3, s4 - s3);
++
++ word1 = g_strndup(s5, s6 - s5);
+ if (st_str_like(word1, ST_NUMERIC))
+ info->stream->station_id = atoi(word1);
+ g_free(word1);
+@@ -878,34 +904,23 @@
+ else
+ PARSE_ERROR;
+ }
+- else if ((s1 = st_strstr_span(line, "alt=\"More broadcaster info"))
+- && (s2 = st_strchr_span(s1, '>'))
+- && (s3 = strstr(s2, "</a>")))
+- {
+- if (info->stream)
+- {
+- g_free(info->stream->broadcaster);
+- info->stream->broadcaster = st_sgml_ref_expand_len(s2, s3 - s2);
+- }
+- else
+- PARSE_ERROR;
+- }
+ else if ((s1 = st_str_has_prefix_span(line, "<TD CLASS=\"connection\""))
+ && (s2 = st_strchr_span(s1, '>'))
+- && (s3 = strstr(s2, "<br>"))
+- && ((s4 = strstr(s3, "<img src='/images/mp3pro"))
+- || (s4 = strstr(s3, "</TD>"))))
++ && (s3 = strchr(s2, '<')))
+ {
+ if (info->stream)
+ {
+ word1 = st_sgml_ref_expand_len(s2, s3 - s2);
+- s3 += 4; word2 = st_sgml_ref_expand_len(s3, s4 - s3);
+-
++
+ g_free(info->stream->audio);
+- info->stream->audio = g_strdup_printf(g_str_has_prefix(s4, "</TD>") ? "%s %s" : "%s %s, MP3Pro", word2, word1);
+
+- g_free(word1);
+- g_free(word2);
++ if (strstr(s3, "<img src='/images/mp3pro"))
++ {
++ info->stream->audio = g_strdup_printf("%s, MP3Pro", word1);
++ g_free(word1);
++ }
++ else
++ info->stream->audio = word1;
+ }
+ else
+ PARSE_ERROR;
+@@ -947,12 +962,17 @@
+ else
+ PARSE_ERROR;
+ }
+- else if (strstr(line, "TD CLASS=\"tabledesc2\""))
++ else if ((s1 = st_strstr_span(line, "<TD CLASS=\"desc\"")))
+ {
+ if (info->stream)
+ {
+ if (info->stream->station_id)
+ {
++ if ((s2 = st_strstr_span(s1, "<a class='desc-link' href='"))
++ && (s3 = st_strchr_span(s2, '>'))
++ && (s4 = strstr(s3, "<BR>")))
++ info->stream->description = st_sgml_ref_expand_len(s3, s4 - s3);
++
+ ((STStream *) info->stream)->name = g_strdup_printf("%i", info->stream->station_id);
+ *(info->streams) = g_list_append(*(info->streams), info->stream);
+ }
+@@ -962,23 +982,23 @@
+ stream_free_cb(info->stream, NULL);
+ }
+
+- info->finished_stream = info->stream;
+ info->stream = NULL;
+ }
+ else
+ PARSE_ERROR;
+ }
+- else if ((s1 = st_strstr_span(line, "<a class='desc-link' href='"))
+- && (s2 = st_strchr_span(s1, '>'))
+- && (s3 = strstr(s2, "<BR>")))
+- {
+- if (info->finished_stream)
+- {
+- info->finished_stream->description = st_sgml_ref_expand_len(s2, s3 - s2);
+- info->finished_stream = NULL;
++ else if ((s1 = st_strstr_span(line, "<TD class=\"pagination\""))
++ && (s2 = st_strstr_span(s1, ">Showing "))
++ && (s3 = strchr(s2, '-')))
++ {
++ word1 = g_strndup(s2, s3 - s2);
++ if (st_str_like(word1, ST_NUMERIC))
++ {
++ int n = atoi(word1);
++ if (n == 1 && ! info->first_page)
++ info->looped = TRUE;
+ }
+- else
+- PARSE_ERROR;
++ g_free(word1);
+ }
+ else if (strstr(line, "Next</A>"))
+ info->has_next_page = TRUE;
476e4f713b80'>logstatsplain d---------autopano-sift178logstatsplain d---------autoq3d146logstatsplain d---------autotrace178logstatsplain d---------aview146logstatsplain d---------ayam178logstatsplain d---------backfract109logstatsplain d---------barbecue109logstatsplain d---------barcode146logstatsplain d---------batik109logstatsplain d---------bbrb178logstatsplain d---------blender-doc178logstatsplain d---------blender178logstatsplain d---------bmeps178logstatsplain d---------bmp-rootvis109logstatsplain d---------bmp2html109logstatsplain d---------bugle146logstatsplain d---------c-a-i-r141logstatsplain d---------cadubi146logstatsplain d---------cairo-java217logstatsplain d---------cairo-reference73logstatsplain d---------cairo178logstatsplain d---------cairomm178logstatsplain d---------cal3d-devel146logstatsplain d---------cal3d146logstatsplain d---------camediaplay146logstatsplain d---------camera146logstatsplain d---------camerakit146logstatsplain d---------cbrpager109logstatsplain d---------cbview109logstatsplain d---------cegui146logstatsplain d---------cenon146logstatsplain d---------cfdg178logstatsplain d---------chbg178logstatsplain d---------cimg178logstatsplain d---------cinepaint178logstatsplain d---------claraocr178logstatsplain d---------clutter-box2d146logstatsplain d---------clutter-cairo146logstatsplain d---------clutter-gtk146logstatsplain d---------clutter146logstatsplain d---------comical109logstatsplain d---------comix178logstatsplain d---------compupic146logstatsplain d---------corona146logstatsplain d---------cosmoplayer109logstatsplain d---------cqcam217logstatsplain d---------crw109logstatsplain d---------crystalentitylayer-devel146logstatsplain d---------crystalentitylayer146logstatsplain d---------crystalspace-devel146logstatsplain d---------crystalspace178logstatsplain d---------cthumb178logstatsplain d---------cuneiform146logstatsplain d---------curator141logstatsplain d---------cuttlefish146logstatsplain d---------danpei146logstatsplain d---------darknock146logstatsplain d---------dataplot178logstatsplain d---------dc20ctrl141logstatsplain d---------dc20pack178logstatsplain d---------dc3play109logstatsplain d---------dcraw109logstatsplain d---------demeter178logstatsplain d---------devil178logstatsplain d---------dia178logstatsplain d---------diacanvas2178logstatsplain d---------digikam-doc146logstatsplain d---------digikam-kde4178logstatsplain d---------digikam178logstatsplain d---------divxcalc141logstatsplain d---------djview4178logstatsplain d---------djvulibre-nox11178logstatsplain d---------djvulibre178logstatsplain d---------dore178logstatsplain d---------dri178logstatsplain d---------driconf146logstatsplain d---------duhdraw109logstatsplain d---------dynamechs178logstatsplain d---------ecg2png109logstatsplain d---------ecore-evas146logstatsplain d---------ecore-sdl146logstatsplain d---------edje146logstatsplain d---------edje_viewer146logstatsplain d---------electriceyes178logstatsplain d---------enblend109logstatsplain d---------enfle178logstatsplain d---------eog146logstatsplain d---------epdfview178logstatsplain d---------epeg146logstatsplain d---------epix178logstatsplain d---------eps2png146logstatsplain d---------epsilon146logstatsplain d---------epstool109logstatsplain d---------esmart178logstatsplain d---------eterm-bg146logstatsplain d---------evas-core178logstatsplain d---------evas-engine-buffer146logstatsplain d---------evas-engine-opengl146logstatsplain d---------evas-engine-sdl146logstatsplain d---------evas-engine-x11146logstatsplain d---------evas-engine-xrender146logstatsplain d---------evas-loader-edb146logstatsplain d---------evas-loader-eet146logstatsplain d---------evas-loader-gif146logstatsplain d---------evas-loader-jpeg146logstatsplain d---------evas-loader-png146logstatsplain d---------evas-loader-svg146logstatsplain d---------evas-loader-tiff146logstatsplain d---------evas-loader-xpm146logstatsplain d---------evas73logstatsplain d---------evince146logstatsplain d---------evolvotron178logstatsplain d---------exact-image109logstatsplain d---------exhibit109logstatsplain d---------exif146logstatsplain d---------exifprobe109logstatsplain d---------exiftags109logstatsplain d---------exiv2146logstatsplain d---------exrtools109logstatsplain d---------f-spot178logstatsplain d---------f90gl178logstatsplain d---------fbm178logstatsplain d---------feh178logstatsplain d---------ffff141logstatsplain d---------fig2pstricks109logstatsplain d---------fig2sxd109logstatsplain d---------figurine146logstatsplain d---------flashplayer109logstatsplain d---------flasm141logstatsplain d---------fli2gif178logstatsplain d---------flip109logstatsplain d---------flphoto178logstatsplain d---------fly178logstatsplain d---------fnlib178logstatsplain d---------fortytwo178logstatsplain d---------fotofix109logstatsplain d---------fpc-cairo73logstatsplain d---------fpc-fpgtk73logstatsplain d---------fpc-ggi73logstatsplain d---------fpc-graph73logstatsplain d---------fpc-imagemagick73logstatsplain d---------fpc-imlib73logstatsplain d---------fpc-libgd73logstatsplain d---------fpc-libpng73logstatsplain d---------fpc-ncurses73logstatsplain d---------fpc-opengl73logstatsplain d---------fpc-pasjpeg73logstatsplain d---------fpc-svgalib73logstatsplain d---------fracplanet109logstatsplain d---------fractorama178logstatsplain d---------fraqtive146logstatsplain d---------freeglut217logstatsplain d---------freeimage141logstatsplain d---------frei0r109logstatsplain d---------frontline146logstatsplain d---------ftgl146logstatsplain d---------fujiplay141logstatsplain d---------fusefs-gphotofs109logstatsplain d---------fv109logstatsplain d---------fyre146logstatsplain d---------g2178logstatsplain d---------g3dviewer178logstatsplain d---------gauche-gl178logstatsplain d---------gcolor109logstatsplain d---------gcolor2178logstatsplain d---------gd178logstatsplain d---------gdal-grass146logstatsplain d---------gdal178logstatsplain d---------gdchart178logstatsplain d---------gdk-pixbuf178logstatsplain d---------gdtclft178logstatsplain d---------geeqie146logstatsplain d---------gegl146logstatsplain d---------geist178logstatsplain d---------geoapi146logstatsplain d---------geomorph178logstatsplain d---------geomview146logstatsplain d---------geos146logstatsplain d---------geoserver217logstatsplain d---------gephex178logstatsplain d---------gfont146logstatsplain d---------giblib146logstatsplain d---------gif2png146logstatsplain d---------giflib178logstatsplain d---------gifmerge109logstatsplain d---------gifsicle146logstatsplain d---------giftool180logstatsplain d---------giftrans141logstatsplain d---------gimageview178logstatsplain d---------gimmage178logstatsplain d---------gimp-app178logstatsplain d---------gimp-data-extras146logstatsplain d---------gimp-gap178logstatsplain d---------gimp-greycstoration146logstatsplain d---------gimp-help146logstatsplain d---------gimp-lqr-plugin146logstatsplain d---------gimp-manual-html192logstatsplain d---------gimp-manual-pdf36logstatsplain d---------gimp73logstatsplain d---------gimpfx-foundry146logstatsplain d---------gimpshop178logstatsplain d---------giram178logstatsplain d---------gkrellkam141logstatsplain d---------gkrellkam2141logstatsplain d---------gle-graphics178logstatsplain d---------gle178logstatsplain d---------glean141logstatsplain d---------glew178logstatsplain d---------glexcess146logstatsplain d---------glfw178logstatsplain d---------glide3178logstatsplain d---------glitz146logstatsplain d---------gliv178logstatsplain d---------glpng146logstatsplain d---------gltk146logstatsplain d---------gltt178logstatsplain d---------gmt178logstatsplain d---------gnash-devel146logstatsplain d---------gnash178logstatsplain d---------gnofract4d146logstatsplain d---------gnomecanvas110logstatsplain d---------gnomeiconedit178logstatsplain d---------gnustep-slideshow146logstatsplain d---------gnustep-slideshowkit146logstatsplain d---------gocr109logstatsplain d---------goocanvas146logstatsplain d---------goocanvasmm146logstatsplain d---------goom146logstatsplain d---------gozer178logstatsplain d---------gpaint109logstatsplain d---------gphoto2146logstatsplain d---------gpicview146logstatsplain d---------gplot178logstatsplain d---------gpsmanshp178logstatsplain d---------gqview-devel178logstatsplain d---------gqview178logstatsplain d---------gracula178logstatsplain d---------grads178logstatsplain d---------grafx2178logstatsplain d---------graphopt178logstatsplain d---------graphviz178logstatsplain d---------gridpix217logstatsplain d---------grx178logstatsplain d---------gscan2pdf146logstatsplain d---------gsculpt178logstatsplain d---------gsnapshot178logstatsplain d---------gstreamer-plugins-aalib36logstatsplain d---------gstreamer-plugins-cairo36logstatsplain d---------gstreamer-plugins-gdkpixbuf36logstatsplain d---------gstreamer-plugins-jpeg36logstatsplain d---------gstreamer-plugins-libcaca36logstatsplain d---------gstreamer-plugins-libpng36logstatsplain d---------gstreamer-plugins-libvisual36logstatsplain d---------gthumb178logstatsplain d---------gtkam178logstatsplain d---------gtkdps146logstatsplain d---------gtkfig141logstatsplain d---------gtkgraph178logstatsplain d---------gtksee146logstatsplain d---------gts178logstatsplain d---------guilib178logstatsplain d---------gview146logstatsplain d---------gwenview-kde4146logstatsplain d---------gwenview146logstatsplain d---------gx146logstatsplain d---------hobbes-icons-xpm146logstatsplain d---------hppsmtools109logstatsplain d---------hs-HGL-ghc146logstatsplain d---------hs-HGL146logstatsplain d---------hs-hgl185logstatsplain d---------hsetroot141logstatsplain d---------hugin178logstats