mirror of
https://github.com/ossrs/srs.git
synced 2025-11-24 03:44:02 +08:00
## Problem HLS and DASH components had redundant `enabled` flag checks in their `cycle()` and `cleanup_delay()` methods that prevented proper cleanup of files when components were disabled. This created a race condition where: 1. Stream stops publishing and HLS/DASH components get disabled 2. `cycle()` returns early without performing disposal operations 3. `cleanup_delay()` returns 0 instead of configured disposal timeout 4. Source cleanup doesn't wait long enough for file disposal 5. HLS/DASH files remain on disk without proper cleanup ## Root Cause The `enabled` flag should control processing of **new incoming streams**, but should NOT prevent **cleanup of existing files** from previously enabled streams. ## Solution Remove redundant `enabled` checks from: - `SrsHls::cycle()` and `SrsDash::cycle()` - Allow disposal logic to run even when disabled - `SrsHls::cleanup_delay()` and `SrsDash::cleanup_delay()` - Always return proper disposal timeout --------- Co-authored-by: winlin <winlinvip@gmail.com>