mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
dashdemux: Fix sync sample selection based on target time in reverse playback mode
This commit is contained in:
parent
b3e2657ac1
commit
4efa3185bb
1 changed files with 24 additions and 4 deletions
|
@ -1584,10 +1584,30 @@ gst_dash_demux_stream_advance_sync_sample (GstAdaptiveDemuxStream * stream,
|
|||
GST_TIME_ARGS (dashstream->current_fragment_keyframe_distance),
|
||||
GST_TIME_ARGS (stream->fragment.duration));
|
||||
|
||||
idx =
|
||||
(target_time -
|
||||
dashstream->current_fragment_timestamp) /
|
||||
dashstream->current_fragment_keyframe_distance;
|
||||
if (stream->demux->segment.rate > 0.0) {
|
||||
idx =
|
||||
(target_time -
|
||||
dashstream->current_fragment_timestamp) /
|
||||
dashstream->current_fragment_keyframe_distance;
|
||||
} else {
|
||||
GstClockTime end_time =
|
||||
dashstream->current_fragment_timestamp +
|
||||
dashstream->current_fragment_duration;
|
||||
|
||||
if (end_time < target_time) {
|
||||
idx = dashstream->moof_sync_samples->len;
|
||||
} else {
|
||||
idx =
|
||||
(end_time -
|
||||
target_time) / dashstream->current_fragment_keyframe_distance;
|
||||
if (idx == dashstream->moof_sync_samples->len) {
|
||||
dashstream->current_sync_sample = -1;
|
||||
fragment_finished = TRUE;
|
||||
goto beach;
|
||||
}
|
||||
idx = dashstream->moof_sync_samples->len - 1 - idx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (stream->pad,
|
||||
|
|
Loading…
Reference in a new issue