changeset 784:5ddfe9eac8ee trunk

[svn] - fix read_replaygain(). necessary fseek was missing in reuse fd code. closes #843. - minor cleanups.
author yaz
date Tue, 06 Mar 2007 01:12:16 -0800
parents 83a38bcfe7c8
children e23b8e1472e3
files ChangeLog src/madplug/decoder.c src/madplug/input.c src/madplug/replaygain.c
diffstat 4 files changed, 21 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- 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 <yaz@cc.rim.or.jp>
+  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 <nenolod@sacredspiral.co.uk>
   revision [1662]
   - reject files which use Ogg container magic
--- 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);
--- 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
--- 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);