Filesize Bug in NJB3 Workaround

Richard Low <[email protected]> Thu, 22 Sep 2005 09:19:32 +0100
Newsgroups gmane.comp.multimedia.libnjb.user
Message-ID <[email protected]>
Hi,

An XNJB user has alerted me to this bug in the NJB3 record feature.

If you record something from line in and save as MP3, then the  
filesize reported by the jukebox in the track listing is slightly  
less than the filesize reported when you request the file chunk.  The  
difference is typically a few tens of KB.  The result is libnjb  
thinks extraneous bytes have been received and fails.  The following  
change to 2.2.3's procedure.c appears to be a solution:

1107,1114c1107
<
<                       if (chunk_size > remain)
<                       {
<                               printf("LIBNJB panic: chunk_size >  
remain, going to get whole chunk and see what happens\n");
<                               size += (chunk_size - remain);
<                               remain = chunk_size;
<                       }
<       else if ( chunk_size == -1 ) {
---
 >       if ( chunk_size == -1 ) {

This works for the MP3 files in question on my NJB3 and the user's  
NJB3, plus my Micro works without ever running this code (I don't see  
the panic message).  Are there any other implications of this  
change?  This will now never cause extraneous bytes panics - is this  
a problem?

Richard.


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php