changeset 2589:ea470384e752 trunk

[svn] - add vfs_buffered_file_release_live_fd().
author nenolod
date Tue, 27 Feb 2007 04:09:06 -0800
parents c51a5a735f65
children c0e5cf2273ad
files ChangeLog src/audacious/Makefile src/audacious/build_stamp.c src/audacious/vfs_buffered_file.c src/audacious/vfs_buffered_file.h
diffstat 5 files changed, 32 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Feb 27 03:49:22 2007 -0800
+++ b/ChangeLog	Tue Feb 27 04:09:06 2007 -0800
@@ -1,3 +1,12 @@
+2007-02-27 11:49:22 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [4186]
+  - proxy requests for metadata attached to a VFSBufferedFile to the live 
+    FD associated with the VFSBufferedFile.
+  
+  trunk/src/audacious/vfs_buffered_file.c |   11 ++++++++++-
+  1 file changed, 10 insertions(+), 1 deletion(-)
+
+
 2007-02-27 10:15:51 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [4184]
   - always make sure we are operating on a copy of the ini string
--- a/src/audacious/Makefile	Tue Feb 27 03:49:22 2007 -0800
+++ b/src/audacious/Makefile	Tue Feb 27 04:09:06 2007 -0800
@@ -47,6 +47,7 @@
 	util.h \
 	vfs.h \
 	vfs_buffer.h \
+	vfs_buffered_file.h \
 	xconvert.h
 
 SOURCES = \
--- a/src/audacious/build_stamp.c	Tue Feb 27 03:49:22 2007 -0800
+++ b/src/audacious/build_stamp.c	Tue Feb 27 04:09:06 2007 -0800
@@ -1,2 +1,2 @@
 #include <glib.h>
-const gchar *svn_stamp = "20070227-4184";
+const gchar *svn_stamp = "20070227-4186";
--- a/src/audacious/vfs_buffered_file.c	Tue Feb 27 03:49:22 2007 -0800
+++ b/src/audacious/vfs_buffered_file.c	Tue Feb 27 04:09:06 2007 -0800
@@ -38,7 +38,9 @@
     {
         VFSBufferedFile *handle = (VFSBufferedFile *) file->handle;
 
-        vfs_fclose(handle->fd);
+        if (handle->fd != NULL)
+            vfs_fclose(handle->fd);
+
         vfs_fclose(handle->buffer);
         g_free(handle->mem);
         g_free(handle);
@@ -222,3 +224,18 @@
     return handle;
 }
 
+VFSFile *
+vfs_buffered_file_release_live_fd(VFSFile *fd)
+{
+    VFSBufferedFile *file = (VFSBufferedFile *) fd;
+    VFSFile *out;
+
+    g_return_val_if_fail(file != NULL, NULL);
+
+    out = file->fd;
+    file->fd = NULL;
+
+    vfs_fclose(fd);
+
+    return out;
+}
--- a/src/audacious/vfs_buffered_file.h	Tue Feb 27 03:49:22 2007 -0800
+++ b/src/audacious/vfs_buffered_file.h	Tue Feb 27 04:09:06 2007 -0800
@@ -52,6 +52,9 @@
  **/
 VFSFile *vfs_buffered_file_new_from_uri(const gchar *uri);
 
+VFSFile *vfs_buffered_file_release_live_fd(VFSFile *fd);
+
+
 G_END_DECLS
 
 #endif