mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-09 13:21:16 +00:00
hlsdemux: switch to higher/lower bitrate by more than one step at a time
This commit is contained in:
parent
6436747eb0
commit
0c97deb59d
1 changed files with 9 additions and 3 deletions
|
@ -1229,14 +1229,20 @@ gst_hls_demux_switch_playlist (GstHLSDemux * demux)
|
|||
|
||||
/* if we are on time switch to a higher bitrate */
|
||||
if (diff > limit) {
|
||||
gst_hls_demux_change_playlist (demux, TRUE);
|
||||
while (diff > limit) {
|
||||
gst_hls_demux_change_playlist (demux, TRUE);
|
||||
diff -= limit;
|
||||
}
|
||||
demux->accumulated_delay = 0;
|
||||
} else if (diff < 0) {
|
||||
/* if the client is too slow wait until it has accumulated a certain delay to
|
||||
* switch to a lower bitrate */
|
||||
demux->accumulated_delay -= diff;
|
||||
if (demux->accumulated_delay >= limit) {
|
||||
gst_hls_demux_change_playlist (demux, FALSE);
|
||||
} else if (demux->accumulated_delay < 0) {
|
||||
while (demux->accumulated_delay >= limit) {
|
||||
gst_hls_demux_change_playlist (demux, FALSE);
|
||||
demux->accumulated_delay -= limit;
|
||||
}
|
||||
demux->accumulated_delay = 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue