# HG changeset patch # User nenolod # Date 1172331674 28800 # Node ID bdd0ee5888e00dfb94ad537d507d98438f2a325e # Parent 07b990906823f1c3128256567fb1b2ee14c9519b [svn] - add support for opening id3 tags from a live vfs handle. Patch by Christian Birchinger (joker). diff -r 07b990906823 -r bdd0ee5888e0 ChangeLog --- a/ChangeLog Sat Feb 24 06:01:39 2007 -0800 +++ b/ChangeLog Sat Feb 24 07:41:14 2007 -0800 @@ -1,3 +1,15 @@ +2007-02-24 14:01:39 +0000 William Pitcock + revision [4134] + - add reference-counting to VFS and add new function, vfs_dup() to + mark a VFS handle as duplicated. + + trunk/src/audacious/vfs.c | 24 ++++++++++++++++++++++++ + trunk/src/audacious/vfs.h | 4 ++++ + trunk/src/audacious/vfs_buffer.c | 1 + + trunk/src/audacious/vfs_buffered_file.c | 1 + + 4 files changed, 30 insertions(+) + + 2007-02-24 04:10:54 +0000 William Pitcock revision [4132] - provide fd->uri for buffered files diff -r 07b990906823 -r bdd0ee5888e0 src/audacious/build_stamp.c --- a/src/audacious/build_stamp.c Sat Feb 24 06:01:39 2007 -0800 +++ b/src/audacious/build_stamp.c Sat Feb 24 07:41:14 2007 -0800 @@ -1,2 +1,2 @@ #include -const gchar *svn_stamp = "20070224-4132"; +const gchar *svn_stamp = "20070224-4134"; diff -r 07b990906823 -r bdd0ee5888e0 src/libid3tag/file.c --- a/src/libid3tag/file.c Sat Feb 24 06:01:39 2007 -0800 +++ b/src/libid3tag/file.c Sat Feb 24 07:41:14 2007 -0800 @@ -473,6 +473,35 @@ } /* + * NAME: file->vfsopen() + * DESCRIPTION: open a file given its vfs + */ +struct id3_file *id3_file_vfsopen(VFSFile *iofile, enum id3_file_mode mode) +{ + struct id3_file *file; + glong curpos; + gchar *path; + + assert(iofile); + + path = iofile->uri; + + vfs_dup(iofile); + + curpos = vfs_ftell(iofile); + vfs_fseek(iofile, 0, SEEK_SET); + + file = new_file(iofile, mode, path); + if (file == 0){ + printf("id3_vfs_open: file failed\n"); + } + + vfs_fseek(iofile, curpos, SEEK_SET); + + return file; +} + +/* * NAME: file->fdopen() * DESCRIPTION: open a file using an existing file descriptor */ diff -r 07b990906823 -r bdd0ee5888e0 src/libid3tag/id3tag.h --- a/src/libid3tag/id3tag.h Sat Feb 24 06:01:39 2007 -0800 +++ b/src/libid3tag/id3tag.h Sat Feb 24 07:41:14 2007 -0800 @@ -29,6 +29,8 @@ extern "C" { # endif +#include + # define ID3_TAG_VERSION 0x0400 # define ID3_TAG_VERSION_MAJOR(x) (((x) >> 8) & 0xff) # define ID3_TAG_VERSION_MINOR(x) (((x) >> 0) & 0xff) @@ -245,6 +247,7 @@ }; struct id3_file *id3_file_open(char const *, enum id3_file_mode); +struct id3_file *id3_file_vfsopen(VFSFile *, enum id3_file_mode); struct id3_file *id3_file_fdopen(int, enum id3_file_mode); int id3_file_close(struct id3_file *);