diff options
-rw-r--r-- | gst/qtdemux/qtdemux.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index dbb822863..01701a2e4 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -3018,9 +3018,16 @@ gst_qtdemux_activate_segment (GstQTDemux * qtdemux, QtDemuxStream * stream, start = MIN (segment->media_start + seg_time, stop); time = offset; } else { - start = segment->media_start; + if (segment->media_start >= qtdemux->segment.start) { + start = segment->media_start; + time = segment->time; + } else { + start = qtdemux->segment.start; + time = segment->time + (qtdemux->segment.start - segment->media_start); + } + + start = MAX (segment->media_start, qtdemux->segment.start); stop = MIN (segment->media_start + seg_time, stop); - time = segment->time; } GST_DEBUG_OBJECT (qtdemux, "newsegment %d from %" GST_TIME_FORMAT |