[Alsaplayer-devel] mp3 decoding issues
Dominique Michel
dominique.michel at citycable.ch
Tue Oct 2 19:37:15 BST 2007
Le Mon, 1 Oct 2007 14:46:44 +0200,
"Yann Suissa" <yann.suissa at gmail.com> a écrit :
> >> 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
I try to apply your changes, but get only a compilation error:
mad_engine.c: In function 'fill_buffer':
mad_engine.c:171: error: 'struct mad_local_data' has no member named 'bufsize'
mad_engine.c:172: error: 'struct mad_local_data' has no member named 'bufsize'
mad_engine.c:173: error: 'struct mad_local_data' has no member named 'bufsize'
...
make[3]: *** [mad_engine.lo] Erreur 1
...
Can you please make a diff of your changes against the last svn version (or the
0.99.80-rc2 version) and send it to the list?
Thanks,
Dominique
More information about the alsaplayer-devel
mailing list