Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Impacted Version
Both v6 and v7.
How to reproduce?
develop
or6.0release
branch../objs/srs -c conf/hls.conf
ffmpeg -re -i ./doc/source.flv -c copy -f flv rtmp://localhost/live/livestream
publish a stream for more than 10 seconds to generate the.m3u8
and.ts
file.q
to quite ffmpeg push stream../objs/nginx/html/live/
folder, whether the.m3u8
and.ts
files still exist.the expected behavior is that the
.m3u8
and.ts
files should cleanup a few seconds later after rtmp stop publish.Cause
Introduced by #4097
The hls segments cleanup process is running in this way previously.
srs/trunk/src/app/srs_app_source.cpp
Lines 1847 to 1875 in f8319d6
A timer run above method in period,
source->cycle()
will run the hls and dashdispose()
method to cleanup segment files.But the
cycle()
will exit before rundispose
, after #4097 introduced theenabled
variable.Solution
run
source->dispose();
before destroySrsLiveSource
.