mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
[MOVED FROM GST-P-FARSIGHT] Limit timestamp diff in case of a jump in the timestamps
20080211222431-4f0f6-726fc66403081533371f775954aab4c7b8fdc643.gz
This commit is contained in:
parent
84adcfdd81
commit
e462189753
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue