Commit 05aa1959 authored by Olivier Crête's avatar Olivier Crête 👻 Committed by Sebastian Dröge

theoradec: Keep timestamp from incoming buffer if it is valid

Fixes bug #601627.
parent 1da5a3f7
......@@ -1333,15 +1333,15 @@ theora_dec_decode_buffer (GstTheoraDec * dec, GstBuffer * buf)
GST_LOG_OBJECT (dec, "decode buffer of size %ld", packet.bytes);
if (dec->have_header) {
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
dec->last_timestamp = GST_BUFFER_TIMESTAMP (buf);
} else if (dec->have_header) {
if (packet.granulepos != -1) {
dec->granulepos = packet.granulepos;
dec->last_timestamp = _theora_granule_start_time (dec, packet.granulepos);
} else if (dec->last_timestamp != -1) {
dec->last_timestamp = _theora_granule_start_time (dec, dec->granulepos);
}
if (dec->last_timestamp == -1 && GST_BUFFER_TIMESTAMP_IS_VALID (buf))
dec->last_timestamp = GST_BUFFER_TIMESTAMP (buf);
} else {
dec->last_timestamp = -1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment