summaryrefslogtreecommitdiffstats
path: root/ext/speex/gstspeexdec.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2008-04-30 09:48:11 +0000
committerWim Taymans <wim.taymans@gmail.com>2008-04-30 09:48:11 +0000
commit882a710c29506ce4a3dd2c799a36f5b5c3e5ca9a (patch)
treec2347d40547f2d382136905618888c7d40fda976 /ext/speex/gstspeexdec.c
parent0062c4d6d0b733fe7620aec1091a9113673de2ba (diff)
ext/speex/gstspeexdec.c: Produce concealment data when time progresses in a segment update.
Original commit message from CVS: * ext/speex/gstspeexdec.c: (speex_dec_sink_event), (speex_dec_chain_parse_data): Produce concealment data when time progresses in a segment update.
Diffstat (limited to 'ext/speex/gstspeexdec.c')
-rw-r--r--ext/speex/gstspeexdec.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/speex/gstspeexdec.c b/ext/speex/gstspeexdec.c
index 01e9d2b3..c0cba930 100644
--- a/ext/speex/gstspeexdec.c
+++ b/ext/speex/gstspeexdec.c
@@ -460,6 +460,18 @@ speex_dec_sink_event (GstPad * pad, GstEvent * event)
if (rate <= 0.0)
goto newseg_wrong_rate;
+ if (update) {
+ /* time progressed without data, see if we can fill the gap with
+ * some concealment data */
+ if (dec->segment.last_stop < start) {
+ GstClockTime duration;
+
+ duration = dec->segment.last_stop - start;
+ speex_dec_chain_parse_data (dec, NULL, dec->segment.last_stop,
+ duration);
+ }
+ }
+
/* now configure the values */
gst_segment_set_newsegment_full (&dec->segment, update,
rate, arate, GST_FORMAT_TIME, start, stop, time);
@@ -654,6 +666,7 @@ speex_dec_chain_parse_data (GstSpeexDec * dec, GstBuffer * buf,
/* copy timestamp */
} else {
+ /* concealment data, pass NULL as the bits parameters */
GST_DEBUG_OBJECT (dec, "creating concealment data");
fpp = dec->header->frames_per_packet;
bits = NULL;