mirror of
https://github.com/ossrs/srs.git
synced 2025-11-23 19:34:05 +08:00
**Problem**: Newly created sources (RTMP/SRT/RTC/RTSP) were being immediately marked as "dead" and deleted by the cleanup timer before publishers could connect, causing "new live source, dead=1" errors. **Root Cause**: All source constructors initialized `stream_die_at_ = 0`, causing `stream_is_dead()` to return `true` immediately since current time was always greater than `0 + 3 seconds`. **Solution**: Changed all four source constructors to initialize `stream_die_at_ = srs_time_now_cached()`, giving newly created sources a proper 3-second grace period before cleanup.