mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
hlsdemux2: Fix segment advance on partial segments.
Fix the duration passed to gst_adaptive_demux2_stream_advance_fragment() when advancing from a partial segment. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883>
This commit is contained in:
parent
e318bc3df5
commit
676fffd23c
1 changed files with 4 additions and 2 deletions
|
@ -1691,6 +1691,8 @@ gst_hls_demux_stream_finish_fragment (GstAdaptiveDemux2Stream * stream)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret == GST_FLOW_OK || ret == GST_FLOW_NOT_LINKED) {
|
if (ret == GST_FLOW_OK || ret == GST_FLOW_NOT_LINKED) {
|
||||||
|
GstClockTime duration = hls_stream->current_segment->duration;
|
||||||
|
|
||||||
/* We can update the stream current position with a more accurate value
|
/* We can update the stream current position with a more accurate value
|
||||||
* before advancing. Note that we don't have any period so we can set the
|
* before advancing. Note that we don't have any period so we can set the
|
||||||
* stream_time as-is on the stream current position */
|
* stream_time as-is on the stream current position */
|
||||||
|
@ -1705,13 +1707,13 @@ gst_hls_demux_stream_finish_fragment (GstAdaptiveDemux2Stream * stream)
|
||||||
g_ptr_array_index (cur_segment->partial_segments,
|
g_ptr_array_index (cur_segment->partial_segments,
|
||||||
hls_stream->part_idx);
|
hls_stream->part_idx);
|
||||||
stream->current_position = part->stream_time;
|
stream->current_position = part->stream_time;
|
||||||
|
duration = part->duration;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stream->current_position = hls_stream->current_segment->stream_time;
|
stream->current_position = hls_stream->current_segment->stream_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
return gst_adaptive_demux2_stream_advance_fragment (stream,
|
return gst_adaptive_demux2_stream_advance_fragment (stream, duration);
|
||||||
hls_stream->current_segment->duration);
|
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue