hlssink3: Don't remove old files if max-files is zero

Follow hlssink2 element's behavior

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1306>
This commit is contained in:
Seungha Yang 2023-08-31 19:57:33 +09:00
parent a8d67cc607
commit 8e4863e9cd

View file

@ -353,7 +353,7 @@ impl HlsSink3 {
gst::StateChangeError
})?;
if state.playlist.is_type_undefined() {
if state.playlist.is_type_undefined() && max_num_segments > 0 {
// Cleanup old segments from filesystem
if state.old_segment_locations.len() > max_num_segments {
for _ in 0..state.old_segment_locations.len() - max_num_segments {