From db9e3b6d92a9b426867e97e5e987a491f29cb798 Mon Sep 17 00:00:00 2001 From: "Arwed v. Merkatz" Date: Mon, 6 Dec 2004 19:32:33 +0000 Subject: set correct buffer durations in mp3parse, set default_duration in matroskamux for mpeg1 audio Original commit message from CVS: set correct buffer durations in mp3parse, set default_duration in matroskamux for mpeg1 audio --- gst/mpegaudioparse/gstmpegaudioparse.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gst/mpegaudioparse') diff --git a/gst/mpegaudioparse/gstmpegaudioparse.c b/gst/mpegaudioparse/gstmpegaudioparse.c index 98fce11c..8e77acac 100644 --- a/gst/mpegaudioparse/gstmpegaudioparse.c +++ b/gst/mpegaudioparse/gstmpegaudioparse.c @@ -417,9 +417,11 @@ gst_mp3parse_chain (GstPad * pad, GstData * _data) mp3parse->in_flush = FALSE; } GST_BUFFER_TIMESTAMP (outbuf) = last_ts; - GST_BUFFER_DURATION (outbuf) = - 8 * (GST_SECOND / 1000) * GST_BUFFER_SIZE (outbuf) / - mp3parse->bit_rate; + if (mp3parse->layer == 1) { + GST_BUFFER_DURATION (outbuf) = 384 * GST_SECOND / mp3parse->rate; + } else { + GST_BUFFER_DURATION (outbuf) = 1152 * GST_SECOND / mp3parse->rate; + } if (GST_PAD_CAPS (mp3parse->srcpad) != NULL) { gst_pad_push (mp3parse->srcpad, GST_DATA (outbuf)); -- cgit v1.2.1