diff options
author | Edward Hervey <edward@centricular.com> | 2015-12-09 19:40:02 +0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2016-04-06 14:08:47 +0300 |
commit | 103c919f3c231ebf0cdd5de7a10aa234ebc070c6 (patch) | |
tree | 20af12b5228fe91c31672b0420f493fa91a53528 | |
parent | d1f87286ab539023d7895a7073545fd3612576bc (diff) |
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
-rw-r--r-- | plugins/elements/gstmultiqueue.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index 479db52e52..2c2c8ef8f0 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -1068,6 +1068,12 @@ apply_segment (GstMultiQueue * mq, GstSingleQueue * sq, GstEvent * event, } 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) sq->sink_tainted = TRUE; else { |