hi, I now compile libmad and madplay in a cross compile environment to build target code for PDA with ARM CPU, after I download target code to ARM PDA, whenever I play any mp3 file on ARM machine, the madplay alway tips me the same error: decode frame 305 , lost sychronization. is this error of libmad or madplay? what cause the error? can any one can tell me. any of your help will be appreciated!
walker
On Jan 18, 2004, at 9:06 AM, zw_0000 wrote:
hi, I now compile libmad and madplay in a cross compile environment to build target code for PDA with ARM CPU, after I download target code to ARM PDA, whenever I play any mp3 file on ARM machine, the madplay alway tips me the same error: decode frame 305 , lost sychronization. is this error of libmad or madplay? what cause the error? can any one can tell me.
MAD_ERROR_LOSTSYNC (lost synchronization) is an error returned by libmad when it fails to find the requisite sync word at the expected location in the bitstream. It usually indicates either (1) a corrupt bitstream, or (2) stream buffer mismanagement in your code. Since the error is fully recoverable, in the case of (1) the solution is simply to continue decoding.
In the case of (2), the most common problem is a failure to copy the unconsumed portion of the bitstream to the beginning of the new buffer after receiving MAD_ERROR_BUFLEN. However, madplay does this correctly, so if you are actually running madplay under ARM unmodified, this should not be a problem.
If the error occurs with any MP3 file, especially at the same frame index (at the same bitrate), then buffer management is definitely a likely culprit.