mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
hlsdemux2: Use gst_hls_media_playlist_recalculate_stream_time()
Instead of recalculating stream times manually in a playlist, let the playlist do it, so that it fixes up partial segment stream times too. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883>
This commit is contained in:
parent
d76aacfb82
commit
2c82fdf276
1 changed files with 4 additions and 8 deletions
|
@ -2186,21 +2186,17 @@ gst_hls_update_time_mappings (GstHLSDemux * demux,
|
|||
static void
|
||||
setup_initial_playlist (GstHLSDemux * demux, GstHLSMediaPlaylist * playlist)
|
||||
{
|
||||
guint idx, len = playlist->segments->len;
|
||||
GstM3U8MediaSegment *segment;
|
||||
GstClockTimeDiff pos = 0;
|
||||
|
||||
GST_DEBUG_OBJECT (demux,
|
||||
"Setting up initial variant segment and time mapping");
|
||||
|
||||
/* This is the initial variant playlist. We will use it to base all our timing
|
||||
* from. */
|
||||
|
||||
for (idx = 0; idx < len; idx++) {
|
||||
segment = g_ptr_array_index (playlist->segments, idx);
|
||||
|
||||
segment->stream_time = pos;
|
||||
pos += segment->duration;
|
||||
segment = g_ptr_array_index (playlist->segments, 0);
|
||||
if (segment) {
|
||||
segment->stream_time = 0;
|
||||
gst_hls_media_playlist_recalculate_stream_time (playlist, segment);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue