multiqueue: Don't use random segment.position from upstream

segment.position is meant for internal usage only, but the various
GST_EVENT_SEGMENT creationg/parsing functions won't clear that field.

Use the appropriate segment boundary as an initial value instead
This commit is contained in:
Edward Hervey 2015-12-09 17:40:02 +01:00 committed by Edward Hervey
parent 2d427c75ae
commit 5f1764232f

View file

@ -1217,6 +1217,12 @@ apply_segment (GstMultiQueue * mq, GstSingleQueue * sq, GstEvent * event,
} }
GST_MULTI_QUEUE_MUTEX_LOCK (mq); GST_MULTI_QUEUE_MUTEX_LOCK (mq);
/* Make sure we have a valid initial segment position (and not garbage
* from upstream) */
if (segment->rate > 0.0)
segment->position = segment->start;
else
segment->position = segment->stop;
if (segment == &sq->sink_segment) if (segment == &sq->sink_segment)
sq->sink_tainted = TRUE; sq->sink_tainted = TRUE;
else { else {