mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-09 02:49:59 +00:00
hlsdemux2: Fix reference leak of variant stream
When switching back to the previous variant stream in gst_hls_demux_change_playlist(), fix a couple of paths that would leak a reference to the previous variant. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2873>
This commit is contained in:
parent
9db19a3b06
commit
025e446470
1 changed files with 8 additions and 2 deletions
|
@ -2673,16 +2673,22 @@ retry_failover_protection:
|
|||
}
|
||||
|
||||
gst_hls_demux_set_current_variant (demux, previous_variant);
|
||||
|
||||
/* Try a lower bitrate (or stop if we just tried the lowest) */
|
||||
if (previous_variant->iframe) {
|
||||
lowest_ivariant = demux->master->iframe_variants->data;
|
||||
if (new_bandwidth == lowest_ivariant->bandwidth)
|
||||
if (new_bandwidth == lowest_ivariant->bandwidth) {
|
||||
gst_hls_variant_stream_unref (previous_variant);
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
lowest_variant = demux->master->variants->data;
|
||||
if (new_bandwidth == lowest_variant->bandwidth)
|
||||
if (new_bandwidth == lowest_variant->bandwidth) {
|
||||
gst_hls_variant_stream_unref (previous_variant);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
gst_hls_variant_stream_unref (previous_variant);
|
||||
return gst_hls_demux_change_playlist (demux, new_bandwidth - 1, changed);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue