mad: helpfully bodge the last buffer to let mad decode the last frame
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 22 Dec 2011 15:23:54 +0000 (15:23 +0000)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 22 Dec 2011 15:23:54 +0000 (15:23 +0000)
commit30e29b6fdbbcd28fc8d70e1146abd54ef0065aa3
treebf9263a96c581e1be1d21ddeed0ec225c952e377
parent20dcefd5c0479b7c3a61c51b311659ea58fceeb3
mad: helpfully bodge the last buffer to let mad decode the last frame

If http://www.mars.org/mailman/public/mad-dev/2001-May/000262.html is
to be believed, the last buffer must be followed by a number of 0 bytes
in order for the last frame to be decoded (at least in some cases).
Doing so seems to work here, fixing a missing 1152 samples when using
mp3parse before mad (not using mp3parse would yield the correct amount
of samples, if there's extra non-MP3 data after (eg, tag data)).
ext/mad/gstmad.c
ext/mad/gstmad.h