The streaming support was breaking because initial packet detection was
failing due to bit reservoir errors. Instead, detect consecutive sync
frames in the initial read buffer, then attempt to sync to a decodable
frame in the first block of data, otherwise give up.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Move minimp3 packet decoder state into the decoder_ex state structure,
instead of using the redundant duplicate structure. Also reduce input
buffer size for streams to 16KiB, and actually use the defined macro in
the header file to declare the streaming buffer size.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Seeking should clear the sample buffer if it contains anything, and non-
seekable files should return an error on an attempt to seek.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
libMAD had memory safety issues, possibly with corrupt files. Hopefully,
this will fix the problem.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>