changeset 427:88c73db9a4b4 trunk

[svn] Use a VFSFile instead of the built-in http, if the VFS supports it.
author iabervon
date Sun, 14 Jan 2007 22:31:16 -0800
parents 31374f283611
children 37b3f45b3a68
files ChangeLog src/mpg123/common.c
diffstat 2 files changed, 24 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Jan 14 19:32:17 2007 -0800
+++ b/ChangeLog	Sun Jan 14 22:31:16 2007 -0800
@@ -1,3 +1,11 @@
+2007-01-15 03:32:17 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [936]
+  - fix dependency generation
+  
+  trunk/src/console/Makefile |    1 +
+  1 file changed, 1 insertion(+)
+
+
 2007-01-15 03:04:03 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [934]
   - fix dependency generation (CFLAGS was not set)
--- a/src/mpg123/common.c	Sun Jan 14 19:32:17 2007 -0800
+++ b/src/mpg123/common.c	Sun Jan 14 22:31:16 2007 -0800
@@ -402,14 +402,10 @@
 mpgdec_open_stream(char *bs_filenam, int fd, unsigned long range)
 {
     filept_opened = 1;
-    if (!strncasecmp(bs_filenam, "http://", 7)) {
-        filept = NULL;
-        mpgdec_http_open(bs_filenam, range);
-        mpgdec_info->filesize = 0;
-        mpgdec_info->network_stream = TRUE;
-        mpgdec_info->stream_type = STREAM_HTTP;
-    } 
-    else
+    filept = vfs_fopen(bs_filenam, "rb");
+    if (filept != NULL) {
+        if (stream_init() == -1) mpgdec_info->eof = TRUE;
+    } else
 #ifdef HAVE_NEMESI
     if (!strncasecmp(bs_filenam, "rtsp://", 7)) {
         filept = NULL;
@@ -417,15 +413,20 @@
         mpgdec_info->network_stream = TRUE;
         mpgdec_info->stream_type = STREAM_RTSP;
         if (mpgdec_rtsp_open(bs_filenam)) mpgdec_info->eof = TRUE;
-    } else {
-#else
-    {
+    } else 
 #endif
-        if ((filept = vfs_fopen(bs_filenam, "rb")) == NULL ||
-            stream_init() == -1)
-            mpgdec_info->eof = TRUE;
+#if 1
+    if (!strncasecmp(bs_filenam, "http://", 7)) {
+        filept = NULL;
+        mpgdec_http_open(bs_filenam, range);
+        mpgdec_info->filesize = 0;
+        mpgdec_info->network_stream = TRUE;
+        mpgdec_info->stream_type = STREAM_HTTP;
+    } else
+#endif
+    {
+        mpgdec_info->eof = TRUE;
     }
-
 }
 
 void