mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
For #1601, flush async on_dvr/on_hls events before stop. 3.0.118
This commit is contained in:
parent
304b92cc36
commit
5be69d290f
6 changed files with 49 additions and 20 deletions
|
@ -740,8 +740,6 @@ srs_error_t SrsDvrSessionPlan::on_publish()
|
|||
|
||||
void SrsDvrSessionPlan::on_unpublish()
|
||||
{
|
||||
SrsDvrPlan::on_unpublish();
|
||||
|
||||
// support multiple publish.
|
||||
if (!dvr_enabled) {
|
||||
return;
|
||||
|
@ -754,6 +752,10 @@ void SrsDvrSessionPlan::on_unpublish()
|
|||
}
|
||||
|
||||
dvr_enabled = false;
|
||||
|
||||
// We should notify the on_dvr, then stop the async.
|
||||
// @see https://github.com/ossrs/srs/issues/1601
|
||||
SrsDvrPlan::on_unpublish();
|
||||
}
|
||||
|
||||
SrsDvrSegmentPlan::SrsDvrSegmentPlan()
|
||||
|
@ -815,14 +817,16 @@ void SrsDvrSegmentPlan::on_unpublish()
|
|||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
SrsDvrPlan::on_unpublish();
|
||||
|
||||
if ((err = segment->close()) != srs_success) {
|
||||
srs_warn("ignore err %s", srs_error_desc(err).c_str());
|
||||
srs_freep(err);
|
||||
}
|
||||
|
||||
dvr_enabled = false;
|
||||
|
||||
// We should notify the on_dvr, then stop the async.
|
||||
// @see https://github.com/ossrs/srs/issues/1601
|
||||
SrsDvrPlan::on_unpublish();
|
||||
}
|
||||
|
||||
srs_error_t SrsDvrSegmentPlan::on_audio(SrsSharedPtrMessage* shared_audio, SrsFormat* format)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue