summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorYouness Alaoui <youness.alaoui@collabora.co.uk>2008-02-11 22:24:31 +0000
committerOlivier CrĂȘte <olivier.crete@collabora.co.uk>2009-03-03 14:34:05 -0500
commite46218975378a27a7859082c1baf59bfada97351 (patch)
treec91c333e27e3c65c2652381a7f8c4183b12797bf /ext
parent84adcfdd81fee610bd93e67b67a54b746cd90b8f (diff)
downloadgst-plugins-bad-e46218975378a27a7859082c1baf59bfada97351.tar.gz
gst-plugins-bad-e46218975378a27a7859082c1baf59bfada97351.tar.bz2
gst-plugins-bad-e46218975378a27a7859082c1baf59bfada97351.zip
[MOVED FROM GST-P-FARSIGHT] Limit timestamp diff in case of a jump in the timestamps
20080211222431-4f0f6-726fc66403081533371f775954aab4c7b8fdc643.gz
Diffstat (limited to 'ext')
-rw-r--r--ext/mimic/gstmimdec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/mimic/gstmimdec.c b/ext/mimic/gstmimdec.c
index 409858fa..4bb82086 100644
--- a/ext/mimic/gstmimdec.c
+++ b/ext/mimic/gstmimdec.c
@@ -288,7 +288,11 @@ gst_mimdec_chain (GstPad *pad, GstBuffer *in)
}
if (mimdec->last_ts != -1) {
- mimdec->gst_timestamp += (mimdec->current_ts - mimdec->last_ts) * GST_MSECOND;
+ int diff = mimdec->current_ts - mimdec->last_ts;
+ if (diff < 0 || diff > 5000) {
+ diff = 1000;
+ }
+ mimdec->gst_timestamp += diff * GST_MSECOND;
}
GST_BUFFER_TIMESTAMP(out_buf) = mimdec->gst_timestamp;
mimdec->last_ts = mimdec->current_ts;