changeset 224:f6bdf10fe48c trunk

[svn] - shoutcast streams don't have a length.
author nenolod
date Sun, 05 Nov 2006 12:50:07 -0800
parents 12346b051297
children 6a512dedcfbe
files ChangeLog src/mpg123/http.c
diffstat 2 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Nov 05 12:36:34 2006 -0800
+++ b/ChangeLog	Sun Nov 05 12:50:07 2006 -0800
@@ -1,3 +1,12 @@
+2006-11-05 20:36:34 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [446]
+  - fix tuple breakage
+  
+  trunk/src/mpg123/mpg123.c |   10 +++-------
+  trunk/src/mpg123/mpg123.h |    3 +++
+  2 files changed, 6 insertions(+), 7 deletions(-)
+
+
 2006-11-05 20:31:33 +0000  William Pitcock <nenolod@nenolod.net>
   revision [444]
   - fix magic detection
--- a/src/mpg123/http.c	Sun Nov 05 12:36:34 2006 -0800
+++ b/src/mpg123/http.c	Sun Nov 05 12:50:07 2006 -0800
@@ -592,8 +592,14 @@
                         if ((cnt = mpgdec_http_read_line(line, 1024)) != -1) {
                             if (!cnt)
                                 break;
-                            if (!strncmp(line, "icy-name:", 9))
+                            if (!strncasecmp(line, "content-length:", 15)) {
+                                mpgdec_info->filesize = atoi(line + 16);
+                            }
+                            else if (!strncmp(line, "icy-name:", 9))
+			    {
+			        mpgdec_info->filesize = 0;
                                 icy_name = g_strdup(line + 9);
+                            }
                             else if (!strncmp(line, "x-audiocast-name:", 17))
                                 icy_name = g_strdup(line + 17);
                             if (!strncmp(line, "icy-metaint:", 12))
@@ -607,10 +613,6 @@
 /*  								udp_serverport = atoi (line + 20); */
 
                             }
-
-                            if (!strncasecmp(line, "content-length:", 15)) {
-                                mpgdec_info->filesize = atoi(line + 15);
-                            }
                         }
                         else {
                             eof = TRUE;