As Thom guessed, he broke the WAV codec while code-policing it...

So, Thom, I'm donating that DVI ADPCM file from my own private collection so that you can fix your bug :-) get it at http://devernay.free.fr/hacks/dviadpcm.wav (it's recorded from an Olympus voice recorder). You can attach it to the codecs page in the wiki if you want (it's 15Kb).

I'm attaching a patch the DEBUGFs I use for the WAV codec, you'll see that chunksize==0 so that the file doesn't play. The previous version worked.

fred

Index: apps/codecs/wav.c
===================================================================
RCS file: /cvsroot/rockbox/apps/codecs/wav.c,v
retrieving revision 1.22
diff -u -r1.22 wav.c
--- apps/codecs/wav.c   20 Mar 2006 20:32:19 -0000      1.22
+++ apps/codecs/wav.c   20 Mar 2006 23:32:39 -0000
@@ -349,6 +349,7 @@
         n -= i + 8;
     }
 
+    DEBUGF("WAVE formattag=0x%04x, channels=%d, avgbytespersec=%d, 
bitspersample=%d\n", formattag, channels, avgbytespersec, bitspersample);
     if (channels == 0) {
         DEBUGF("CODEC_ERROR: 'fmt ' chunk not found or 0-channels file\n");
         i = CODEC_ERROR;
@@ -450,6 +451,7 @@
             ci->seek_complete();
         }
         wavbuf = (uint8_t *)ci->request_buffer((long *)&n, chunksize);
+        DEBUGF("WAVE: decoding %d bytes (requested %d)\n", n, chunksize);
 
         if (n == 0)
             break; /* End of stream */
@@ -500,6 +502,7 @@
 
             for (i = 0; i < nblocks; i++) {
                 size_t decodedsize = samplesperblock*channels;
+                DEBUGF("WAVE: DVI_ADPCM: decoding block %d/%d\n", i+1, 
nblocks);
                 if (decode_dvi_adpcm(ci, ((uint8_t *)wavbuf) + i*blockalign,
                                      blockalign, channels, bitspersample,
                                      samples + i*samplesperblock*channels,

Reply via email to