diff --git a/net/hlssink3/src/imp.rs b/net/hlssink3/src/imp.rs index 5d19cb7c..3d07a071 100644 --- a/net/hlssink3/src/imp.rs +++ b/net/hlssink3/src/imp.rs @@ -334,7 +334,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 {