gst/mpegaudioparse/gstmpegaudioparse.c: All sample-rates < 32khz come from the LSF extensions, which only use 1 granu...

Original commit message from CVS:
* gst/mpegaudioparse/gstmpegaudioparse.c: (gst_mp3parse_chain):
All sample-rates < 32khz come from the LSF extensions, which only
use 1 granule. Fixes parsing of 22.05khz, 24khz and 16khz files.
Use gst_util_uint64_scale because we can.
This commit is contained in:
Jan Schmidt 2006-12-29 14:51:19 +00:00
parent 46e76ef87d
commit 155339b9e2
2 changed files with 12 additions and 2 deletions

View file

@ -1,3 +1,11 @@
2006-12-29 Jan Schmidt <thaytan@mad.scientist.com>
* gst/mpegaudioparse/gstmpegaudioparse.c: (gst_mp3parse_chain):
All sample-rates < 32khz come from the LSF extensions, which only
use 1 granule. Fixes parsing of 22.05khz, 24khz and 16khz files.
Use gst_util_uint64_scale because we can.
2006-12-22 Stefan Kost <ensonic@users.sf.net>
* tests/check/elements/amrnbenc.c: (setup_amrnbenc),

View file

@ -449,12 +449,14 @@ gst_mp3parse_chain (GstPad * pad, GstBuffer * buf)
else if (mp3parse->layer == 2)
spf = 1152;
else {
if (mp3parse->rate < 16000)
/* Any sample_rate < 32000 indicates MPEG-2 or MPEG-2.5 */
if (mp3parse->rate < 32000)
spf = 576;
else
spf = 1152;
}
GST_BUFFER_DURATION (outbuf) = spf * GST_SECOND / mp3parse->rate;
GST_BUFFER_DURATION (outbuf) =
gst_util_uint64_scale (GST_SECOND, spf, mp3parse->rate);
if (GST_CLOCK_TIME_IS_VALID (mp3parse->next_ts)) {
GST_BUFFER_TIMESTAMP (outbuf) = mp3parse->next_ts;