# HG changeset patch # User yaz # Date 1173172336 28800 # Node ID 5ddfe9eac8eee462695efac1b680e1200d8d78b1 # Parent 83a38bcfe7c83ad2229924a85a4495ccc18b4009 [svn] - fix read_replaygain(). necessary fseek was missing in reuse fd code. closes #843. - minor cleanups. diff -r 83a38bcfe7c8 -r 5ddfe9eac8ee ChangeLog --- a/ChangeLog Mon Mar 05 00:48:01 2007 -0800 +++ b/ChangeLog Tue Mar 06 01:12:16 2007 -0800 @@ -1,3 +1,13 @@ +2007-03-05 08:48:01 +0000 Yoshiki Yazawa + revision [1664] + - check the result of vfs_fread() strictly. + + trunk/src/madplug/decoder.c | 4 ++-- + trunk/src/madplug/input.c | 5 ++--- + trunk/src/madplug/plugin.c | 17 +++++++++-------- + 3 files changed, 13 insertions(+), 13 deletions(-) + + 2007-03-05 08:28:52 +0000 William Pitcock revision [1662] - reject files which use Ogg container magic diff -r 83a38bcfe7c8 -r 5ddfe9eac8ee src/madplug/decoder.c --- a/src/madplug/decoder.c Mon Mar 05 00:48:01 2007 -0800 +++ b/src/madplug/decoder.c Tue Mar 06 01:12:16 2007 -0800 @@ -434,7 +434,7 @@ (tlen == 0 || info->size <= 0) ? -1 : tlen, info->bitrate, info->freq, info->channels); #ifdef DEBUG - g_message("decode: tlen = %d\n", tlen); + g_message("decode: tlen = %d", tlen); #endif /* main loop */ @@ -553,8 +553,10 @@ if (!audmad_config.show_avg_vbr_bitrate && info->vbr && (iteration % 40 == 0)) { #ifdef DEBUG +#ifdef DEBUG_INTENSIVELY g_message("decode vbr tlen = %d", tlen); #endif +#endif mad_plugin->set_info(info->title, (tlen == 0 || info->size <= 0) ? -1 : tlen, info->bitrate, info->freq, info->channels); diff -r 83a38bcfe7c8 -r 5ddfe9eac8ee src/madplug/input.c --- a/src/madplug/input.c Mon Mar 05 00:48:01 2007 -0800 +++ b/src/madplug/input.c Tue Mar 06 01:12:16 2007 -0800 @@ -436,7 +436,7 @@ audmad_config.id3_format : xmms_get_gentitle_format(), title_input); // for connection via proxy, we have to stop transfer once. I can't explain the reason. - vfs_fseek(info->infile, -1, SEEK_SET); // impossible request + vfs_fseek(info->infile, -1, SEEK_SET); // an impossible request vfs_fseek(info->infile, curpos, SEEK_SET); #ifdef DEBUG diff -r 83a38bcfe7c8 -r 5ddfe9eac8ee src/madplug/replaygain.c --- a/src/madplug/replaygain.c Mon Mar 05 00:48:01 2007 -0800 +++ b/src/madplug/replaygain.c Tue Mar 06 01:12:16 2007 -0800 @@ -210,21 +210,17 @@ file_info->mp3gain_minmax = -77; if (file_info->infile) { -#ifdef DEBUG - g_message("replaygain: dup"); -#endif fp = vfs_dup(file_info->infile); curpos = vfs_ftell(fp); - } else { + } + else { if ((fp = vfs_fopen(file_info->filename, "rb")) == NULL) return; - if (vfs_fseek(fp, 0L, SEEK_END) != 0) { -#ifdef DEBUG - g_message("replaygain: seek error"); -#endif - vfs_fclose(fp); - return; - } + } + + if (vfs_fseek(fp, 0L, SEEK_END) != 0) { + vfs_fclose(fp); + return; } long pos = vfs_ftell(fp);