Hi!
I am trying to play attached bitstream using mimimad application.
and minimad say to me decoding error 0x0235 at byte offset 0 MAD_ERROR_BADDATAPTR = 0x0235, /* bad main_data_begin pointer */ but my winamp play it well. What is the problem?
I attach only firs 16 kB of bitstream. in start of file there is a header of 0x240 bytes I "remove" it by simple seeking the file pointer.
The problem is located in function int mad_layer_III(MAD_STREAM *stream, MAD_FRAME *frame)
but where exactly here error = III_sideinfo(&stream->ptr, nch, header->flags & MAD_FLAG_LSF_EXT, &si, &data_bitlen, &priv_bitlen); or here - // -------- find main_data of this frame ----------- frame_space = stream->next_frame - mad_bit_nextbyte(&stream->ptr); ...
I don't know.
And one of possibilities is - wrong bitstream? but winamp play it well.
So could some one help me understand what is the problem?
On Aug 5, 2004, at 10:15 PM, Grigory A. wrote:
I am trying to play attached bitstream using mimimad application.
and minimad say to me decoding error 0x0235 at byte offset 0 MAD_ERROR_BADDATAPTR = 0x0235, /* bad main_data_begin pointer */ but my winamp play it well. What is the problem?
This error is caused when a frame's main_data_begin pointer points beyond the available bit reservoir. This can occur if, e.g., the stream has been cut or spliced. (Note that when decoding the very first frame in a stream, this pointer must necessarily be zero.)
When this error occurs, the frame cannot be decoded. However, the bit reservoir contained in the frame will be used to decode future frames. So it is possible to continue decoding even though you will not get any output samples from the failed frame. Depending on the size of the missing bit reservoir, this error may occur in several frames until the reservoir is replenished.
In most cases you can simply ignore the error, as Winamp appears to do. You may want to employ an error concealment strategy, such as repeating the previous successfully decoded frame's subband samples (if any) or muting the frame.