changeset 2430:4e2fc64d95ef trunk

[svn] - make vfs_buffered_file_new_from_uri declaration const - cope properly with subsong URIs
author nenolod
date Sat, 27 Jan 2007 11:40:05 -0800
parents ca5b5523cc2d
children 3ec22a11c83e
files ChangeLog src/audacious/input.c src/audacious/vfs_buffered_file.c src/audacious/vfs_buffered_file.h
diffstat 4 files changed, 22 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Jan 27 11:28:14 2007 -0800
+++ b/ChangeLog	Sat Jan 27 11:40:05 2007 -0800
@@ -1,3 +1,11 @@
+2007-01-27 19:28:14 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [3868]
+  - fix an offset error in the vfs_buffered_file wraparound implementation sections
+  
+  trunk/src/audacious/vfs_buffered_file.c |    6 ++++++
+  1 file changed, 6 insertions(+)
+
+
 2007-01-27 16:22:15 +0000  Yoshiki Yazawa <yaz@cc.rim.or.jp>
   revision [3866]
   - make sure tooltip_file != NULL otherwise filepopup may crash in strcmp().
--- a/src/audacious/input.c	Sat Jan 27 11:28:14 2007 -0800
+++ b/src/audacious/input.c	Sat Jan 27 11:40:05 2007 -0800
@@ -418,11 +418,21 @@
     InputPlugin *ip;
     gchar *filename_proxy;
     gint ret = 1;
-    gchar *ext;
+    gchar *ext, *tmp, *tmp_uri;
     gboolean use_ext_filter;
 
     filename_proxy = g_strdup(filename);
-    fd = vfs_buffered_file_new_from_uri(filename_proxy);
+
+    /* Some URIs will end in ?<subsong> to determine the subsong requested. */
+    tmp_uri = g_strdup(filename);
+
+    tmp = strrchr(tmp_uri, '?');
+
+    if (tmp != NULL)
+        *tmp = '\0';
+
+    fd = vfs_buffered_file_new_from_uri(tmp_uri);
+    g_free(tmp_uri);
 
     ext = strrchr(filename_proxy, '.') + 1;
 
--- a/src/audacious/vfs_buffered_file.c	Sat Jan 27 11:28:14 2007 -0800
+++ b/src/audacious/vfs_buffered_file.c	Sat Jan 27 11:40:05 2007 -0800
@@ -170,7 +170,7 @@
 };
 
 VFSFile *
-vfs_buffered_file_new_from_uri(gchar *uri)
+vfs_buffered_file_new_from_uri(const gchar *uri)
 {
     VFSFile *handle;
     VFSBufferedFile *fd;
--- a/src/audacious/vfs_buffered_file.h	Sat Jan 27 11:28:14 2007 -0800
+++ b/src/audacious/vfs_buffered_file.h	Sat Jan 27 11:40:05 2007 -0800
@@ -50,7 +50,7 @@
  *
  * Return value: A VFSFile handle for the VFSBufferedFile.
  **/
-VFSFile *vfs_buffered_file_new_from_uri(gchar *uri);
+VFSFile *vfs_buffered_file_new_from_uri(const gchar *uri);
 
 G_END_DECLS