From: Wim Taymans Date: Fri, 26 Sep 2008 14:39:42 +0000 (+0000) Subject: ext/amrnb/amrnbenc.*: Pass the discont flag from the input buffer on to the output... X-Git-Tag: 1.19.3~505^2~1533 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0df8ea9ebd43036fb037714852c639c1102289d4;p=platform%2Fupstream%2Fgstreamer.git ext/amrnb/amrnbenc.*: Pass the discont flag from the input buffer on to the output buffer in the AMR encoder. Original commit message from CVS: * ext/amrnb/amrnbenc.c: (gst_amrnbenc_chain), (gst_amrnbenc_state_change): * ext/amrnb/amrnbenc.h: Pass the discont flag from the input buffer on to the output buffer in the AMR encoder. --- diff --git a/ChangeLog b/ChangeLog index f00a7d7..c8bfe7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2008-09-26 Wim Taymans + * ext/amrnb/amrnbenc.c: (gst_amrnbenc_chain), + (gst_amrnbenc_state_change): + * ext/amrnb/amrnbenc.h: + Pass the discont flag from the input buffer on to the output buffer in + the AMR encoder. + +2008-09-26 Wim Taymans + Patch by: Benoit Fouet * ext/amrnb/amrnbparse.c: (gst_amrnbparse_init), diff --git a/ext/amrnb/amrnbenc.c b/ext/amrnb/amrnbenc.c index fa5d24e..2d2a16b 100644 --- a/ext/amrnb/amrnbenc.c +++ b/ext/amrnb/amrnbenc.c @@ -264,6 +264,7 @@ gst_amrnbenc_chain (GstPad * pad, GstBuffer * buffer) if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DISCONT)) { gst_adapter_clear (amrnbenc->adapter); amrnbenc->ts = 0; + amrnbenc->discont = TRUE; } /* take latest timestamp, FIXME timestamp is the one of the @@ -284,8 +285,14 @@ gst_amrnbenc_chain (GstPad * pad, GstBuffer * buffer) out = gst_buffer_new_and_alloc (32); GST_BUFFER_DURATION (out) = amrnbenc->duration; GST_BUFFER_TIMESTAMP (out) = amrnbenc->ts; - if (amrnbenc->ts != -1) + if (amrnbenc->ts != -1) { amrnbenc->ts += amrnbenc->duration; + } + if (amrnbenc->discont) { + GST_BUFFER_FLAG_SET (out, GST_BUFFER_FLAG_DISCONT); + amrnbenc->discont = FALSE; + } + gst_buffer_set_caps (out, GST_PAD_CAPS (amrnbenc->srcpad)); /* The AMR encoder actually writes into the source data buffers it gets */ @@ -332,6 +339,7 @@ gst_amrnbenc_state_change (GstElement * element, GstStateChange transition) amrnbenc->rate = 0; amrnbenc->channels = 0; amrnbenc->ts = 0; + amrnbenc->discont = FALSE; gst_adapter_clear (amrnbenc->adapter); break; default: diff --git a/ext/amrnb/amrnbenc.h b/ext/amrnb/amrnbenc.h index a0afce5..64306dc 100644 --- a/ext/amrnb/amrnbenc.h +++ b/ext/amrnb/amrnbenc.h @@ -46,6 +46,7 @@ struct _GstAmrnbEnc { /* pads */ GstPad *sinkpad, *srcpad; guint64 ts; + gboolean discont; GstAdapter *adapter;