About the "lost synchronisation", "forbidden bitrate" value, I could be wrong but, from what I have found on my side, for avoid most (98%) of these errors; you have to feed the MAD decoder with 1 second chunk.
That means 37 MPEG-1 packets that you detect with the following routine:
#define MPEG1_SYNC_NOT_FOUND -1
//------------------------------------------------------------------------------
//------------------------------------------------------------- FindMPEG1SyncPos
//------------------------------------------------------------------------------
int CMADDecoder::FindMPEG1SyncPos(BYTE *pFrame, int FrameSize){
//------------------------------- Variables --------------------------------
int LastBytePos = FrameSize - 1;
int i ;
//--------------------------------- Code -----------------------------------
//printf ("\n CMADDecoder::FindMPEG1SyncPos:: 0x%08X-%d",
// pFrame, FrameSize);
//fflush(stdout);
for (i = 0; i < LastBytePos; i++){
if ( ((pFrame[i ] == 0xFF) ) &&
((pFrame[i + 1] & 0xFC) == 0xFC) ){
return i;
}// If we found the sync word
}// For all the byte to check
return MPEG1_SYNC_NOT_FOUND; // Not found
}// FindMPEG1SyncPos
Regards
Bruno
-----Message d'origine----- De : mad-dev-bounces@lists.mars.org [mailto:mad-dev-bounces@lists.mars.org] De la part de Håvard Sperle Engebretsen Envoyé : 30 septembre 2005 09:08 À : mad-dev@lists.mars.org Objet : [mad-dev] Errors when running minimad
Hi!
1)
I'm a little bit confused!
I am trying to run libmad in Cygwin and while installing libmad I
flagged the configure command:
"./configure --disable-shared --enable-profiling", and then made the
install. Does this make libmad a static ilbrary so that I don't have to
use the flag "-static" while compiling minimad.c?
(I was told to make the library static because gprof doesn't support
dynamic libraries...)
2)
After having some problems compiling minimad.c I read in another post in
the mad-dev archives that I should use "make minimad.exe" to cimpile it.
This works fine, but when I try to run it with "./minimad <test.mp3>
test.pcm" I get some errors:
decoding error 0x0101 (lost synchronisation) at byte offset 0
decoding error 0x0103 (forbidden bitrate value) at byte offset 163
decoding error 0x0103 (forbidden bitrate value) at byte offset 213
.
.
.
decoding error 0x0104 (reserved sample frequency value) at byte offset
224
decoding error 0x0103 (forbidden bitrate value) at byte offset 295
decoding error 0x0235 (bad main_data_begin pointer) at byte offset 412
Does anyone know what this means?
Thanks in advance!
H
--