hlsdemux2: Fix buffer leak when resynching

Unref the buffer in gst_hls_demux_handle_buffer() when
returning GST_ADAPTIVE_DEMUX_FLOW_LOST_SYNC

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2849>
This commit is contained in:
Jan Schmidt 2022-08-07 20:56:49 +10:00 committed by GStreamer Marge Bot
parent 62c7402dbb
commit 91e43048cf

View file

@ -1484,6 +1484,8 @@ gst_hls_demux_handle_buffer (GstAdaptiveDemux * demux,
*/ */
if (hls_stream->current_segment == NULL) { if (hls_stream->current_segment == NULL) {
GST_WARNING_OBJECT (stream, "Lost sync"); GST_WARNING_OBJECT (stream, "Lost sync");
/* Drop the buffer */
gst_buffer_unref (buffer);
return GST_ADAPTIVE_DEMUX_FLOW_LOST_SYNC; return GST_ADAPTIVE_DEMUX_FLOW_LOST_SYNC;
} }