mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-21 07:46:38 +00:00
hlsdemux2: Fix buffering threshold calculation and handling
* The checks for smaller values were wrong * Properly initialize the stream default recommended buffering threshold so that a default (10s) value is used until the subclass can provide a proper value Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883>
This commit is contained in:
parent
eb1eb64506
commit
3129970c8a
2 changed files with 4 additions and 2 deletions
|
@ -86,6 +86,8 @@ gst_adaptive_demux2_stream_init (GstAdaptiveDemux2Stream * stream)
|
|||
stream->last_ret = GST_FLOW_OK;
|
||||
stream->next_input_wakeup_time = GST_CLOCK_STIME_NONE;
|
||||
|
||||
stream->recommended_buffering_threshold = GST_CLOCK_TIME_NONE;
|
||||
|
||||
stream->fragment_bitrates =
|
||||
g_malloc0 (sizeof (guint64) * NUM_LOOKBACK_FRAGMENTS);
|
||||
|
||||
|
|
|
@ -2547,7 +2547,7 @@ gst_hls_media_playlist_recommended_buffering_threshold (GstHLSMediaPlaylist *
|
|||
&& threshold > playlist->hold_back)
|
||||
threshold = playlist->hold_back;
|
||||
else if (GST_CLOCK_TIME_IS_VALID (playlist->targetduration)
|
||||
&& threshold > playlist->targetduration)
|
||||
&& threshold > 3 * playlist->targetduration)
|
||||
threshold = 3 * playlist->targetduration;
|
||||
|
||||
if (low_latency) {
|
||||
|
@ -2555,7 +2555,7 @@ gst_hls_media_playlist_recommended_buffering_threshold (GstHLSMediaPlaylist *
|
|||
&& threshold > playlist->part_hold_back)
|
||||
threshold = playlist->part_hold_back;
|
||||
else if (GST_CLOCK_TIME_IS_VALID (playlist->partial_targetduration)
|
||||
&& threshold > playlist->partial_targetduration)
|
||||
&& threshold > 3 * playlist->partial_targetduration)
|
||||
threshold = 3 * playlist->partial_targetduration;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue