[Alsaplayer-devel] mp3 decoding issues
Yann Suissa
yann.suissa at gmail.com
Mon Oct 1 13:46:44 BST 2007
>> Hello,
>>
>> I've got a decoding problem with a small mp3 file.
>> The file is 1.30 second long, and i think alsaplayer is rounding to
seconds,
>> i only hear 1 second then the end is cut. mpg123, xmms are working ok
with
>> that file.
>> I've tired to change to the last libmad available, i've tried a lot of
>> ./configure options, i've tried different encoders, different format, but
>> nothing to do the sound is always cut at the end.
>> Another interresting thing that mpg123 there is a smilar cut when i
encode
>> it with something different that 44100Hz (mpg123 use madlib too for
>> decoding).
>>
>> Here is a link to the mp3 file http://asserv.asscot.com/small.mp3
>> If someone could try with his configuration it would be great.
>>
>> Thank in advance
>> Regards
>Thanks for reporting. I was able to reproduce it. I also converted your
file
>into wav, flac and ogg and it was working fine with AlsaPlayer. So, is is a
>libmad related problem. Now, the question is if it is related to AP mad
plugin
>or to libmad.
>
>For the moment, I can only suggest you to use another format like ogg for
that
>kind of compressed files. ogg have another advantage, it is a free format.
>
>Ciao,
>Dominique
Hi Dominique thanks for answering about this problem.
The bug is in the mad plugin, in the file input/mad/mad_engine.c in the
function "fill_buffer"
It's about the mad_map, the way the block are copied near the end of the
file is wrong.
I manage to make a dirty patch for it that i suggest to not use for
production.
Here is the changes i made to make it work, i hope it'll help you to find a
better way to correct it.
#if 0
memmove(data->mad_map, data->mad_map + MAD_BUFSIZE - data->bytes_avail,
data->bytes_avail);
bytes_read = reader_read(data->mad_map + data->bytes_avail, MAD_BUFSIZE
- data->bytes_avail, data->mad_fd);
data->map_offset += (MAD_BUFSIZE - data->bytes_avail); // offset absolue
...
data->bytes_avail += bytes_read;
#else
memmove(data->mad_map, data->mad_map + data->bufsize -
data->bytes_avail, data->bytes_avail);
bytes_read = reader_read(data->mad_map + data->bytes_avail,
data->bufsize - data->bytes_avail, data->mad_fd);
data->map_offset += (data->bufsize - data->bytes_avail); // offset
absolue ...
data->bytes_avail += bytes_read;
data->bufsize = MAD_BUFSIZE;
if (data->bytes_avail != MAD_BUFSIZE)
data->bufsize = data->bytes_avail;
#endif
Regards
Yann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.tartarus.org/pipermail/alsaplayer-devel/attachments/20071001/3f55b1a9/attachment.htm
More information about the alsaplayer-devel
mailing list