# HG changeset patch # User nenolod # Date 1172332146 28800 # Node ID 6bc134eec1f3ad9972020d176805d401227aee63 # Parent 541854f0605cb1e5ac8472ae6eba573dc4247672 [svn] - make use of the new id3_file_vfsopen() function. Patch by Christian Birchinger (joker). diff -r 541854f0605c -r 6bc134eec1f3 ChangeLog --- a/ChangeLog Sat Feb 24 05:58:15 2007 -0800 +++ b/ChangeLog Sat Feb 24 07:49:06 2007 -0800 @@ -1,3 +1,10 @@ +2007-02-24 13:58:15 +0000 Tony Vroon + revision [1496] + Steal parser from paranormal and make sure all datestamps are the same so yacc does not run. + trunk/src/rovascope/libcalc/parser.y | 3 +++ + 1 file changed, 3 insertions(+) + + 2007-02-24 04:30:42 +0000 William Pitcock revision [1494] - VFS probing support patch by Christian Birchinger (joker). diff -r 541854f0605c -r 6bc134eec1f3 src/madplug/input.c --- a/src/madplug/input.c Sat Feb 24 05:58:15 2007 -0800 +++ b/src/madplug/input.c Sat Feb 24 07:49:06 2007 -0800 @@ -345,7 +345,10 @@ else title_input = info->tuple; - info->id3file = id3_file_open(info->filename, ID3_FILE_MODE_READONLY); + if(info->infile) + info->id3file = id3_file_vfsopen(info->infile, ID3_FILE_MODE_READONLY); + else + info->id3file = id3_file_open(info->filename, ID3_FILE_MODE_READONLY); if (!info->id3file) { return; } diff -r 541854f0605c -r 6bc134eec1f3 src/madplug/replaygain.c --- a/src/madplug/replaygain.c Sat Feb 24 05:58:15 2007 -0800 +++ b/src/madplug/replaygain.c Sat Feb 24 07:49:06 2007 -0800 @@ -202,16 +202,21 @@ file_info->mp3gain_undo = -77; file_info->mp3gain_minmax = -77; - VFSFile *fp; + glong curpos = 0; - if ((fp = vfs_fopen(file_info->filename, "rb")) == NULL) - return; - - if (vfs_fseek(fp, 0L, SEEK_END) != 0) { - vfs_fclose(fp); - return; + if (file_info->infile) { + fp = file_info->infile; + curpos = vfs_ftell(fp); + } else { + if ((fp = vfs_fopen(file_info->filename, "rb")) == NULL) + return; + if (vfs_fseek(fp, 0L, SEEK_END) != 0) { + vfs_fclose(fp); + return; + } } + long pos = vfs_ftell(fp); int res = -1; int try = 0; @@ -249,5 +254,9 @@ || file_info->replaygain_track_scale != -1) file_info->has_replaygain = TRUE; - vfs_fclose(fp); + if (curpos) + vfs_fseek(fp, curpos, SEEK_SET); + else + vfs_fclose(fp); + }