2008-09-26 Wim Taymans <wim.taymans@collabora.co.uk>
+ * 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 <wim.taymans@collabora.co.uk>
+
Patch by: Benoit Fouet <benoit dot fouet at purplelabs dot com>
* ext/amrnb/amrnbparse.c: (gst_amrnbparse_init),
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
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 */
amrnbenc->rate = 0;
amrnbenc->channels = 0;
amrnbenc->ts = 0;
+ amrnbenc->discont = FALSE;
gst_adapter_clear (amrnbenc->adapter);
break;
default: