matroskademux: adjust segment stop for KEY_UNIT negative rate seeking

This commit is contained in:
Mark Nauwelaerts 2016-12-29 12:39:20 +01:00
parent 867ce71922
commit e6a251e9c0

View file

@ -2174,13 +2174,19 @@ next:
}
finish:
if (keyunit) {
if (keyunit && seeksegment.rate > 0) {
GST_DEBUG_OBJECT (demux, "seek to key unit, adjusting segment start from %"
GST_TIME_FORMAT " to %" GST_TIME_FORMAT,
GST_TIME_ARGS (seeksegment.start), GST_TIME_ARGS (entry->time));
seeksegment.start = MAX (entry->time, demux->stream_start_time);
seeksegment.position = seeksegment.start;
seeksegment.time = seeksegment.start - demux->stream_start_time;
} else if (keyunit) {
GST_DEBUG_OBJECT (demux, "seek to key unit, adjusting segment stop from %"
GST_TIME_FORMAT " to %" GST_TIME_FORMAT,
GST_TIME_ARGS (seeksegment.stop), GST_TIME_ARGS (entry->time));
seeksegment.stop = MAX (entry->time, demux->stream_start_time);
seeksegment.position = seeksegment.stop;
}
if (demux->streaming) {