From a98a98b5f3f9da77d8e55ad0328ef71eb473db3d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 18 Oct 2004 10:57:45 +0000 Subject: [PATCH] ext/speex/gstspeexenc.c: Fix speex timestamps so that it gets muxed properly. Original commit message from CVS: * ext/speex/gstspeexenc.c: (gst_speexenc_class_init), (gst_speexenc_chain): Fix speex timestamps so that it gets muxed properly. --- ChangeLog | 6 ++++++ ext/speex/gstspeexenc.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index dca0e02bbe..d76f850de1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-10-15 Wim Taymans + + * ext/speex/gstspeexenc.c: (gst_speexenc_class_init), + (gst_speexenc_chain): + Fix speex timestamps so that it gets muxed properly. + 2004-10-15 Wim Taymans * ext/raw1394/gstdv1394src.c: (gst_dv1394src_get_type), diff --git a/ext/speex/gstspeexenc.c b/ext/speex/gstspeexenc.c index adf1cd8029..009a0e1885 100644 --- a/ext/speex/gstspeexenc.c +++ b/ext/speex/gstspeexenc.c @@ -196,7 +196,7 @@ gst_speexenc_class_init (GstSpeexEncClass * klass) 0.0, 10.0, DEFAULT_QUALITY, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BITRATE, g_param_spec_int ("bitrate", "Encoding Bit-rate", - "Specify an encoding bit-rate (in bps). ", + "Specify an encoding bit-rate (in bps). (0 = automatic)", 0, G_MAXINT, DEFAULT_BITRATE, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_VBR, g_param_spec_boolean ("vbr", "VBR", @@ -952,6 +952,10 @@ gst_speexenc_chain (GstPad * pad, GstData * _data) g_assert (written == outsize); speex_bits_reset (&speexenc->bits); + GST_BUFFER_TIMESTAMP (outbuf) = + (speexenc->frameno * frame_size - + speexenc->lookahead) * GST_SECOND / speexenc->rate; + GST_BUFFER_DURATION (outbuf) = frame_size * GST_SECOND / speexenc->rate; GST_BUFFER_OFFSET (outbuf) = speexenc->bytes_out; GST_BUFFER_OFFSET_END (outbuf) = speexenc->frameno * frame_size - speexenc->lookahead;