mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 05:45:58 +00:00
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:
parent
46e76ef87d
commit
155339b9e2
2 changed files with 12 additions and 2 deletions
|
@ -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),
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue