From 978d5e993b680635174b57d79585ecd4449ab871 Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 25 Jan 2020 15:04:34 +0800 Subject: [PATCH] Fix #1108, reap DVR tmp file when unpublish. 3.0.106 --- README.md | 2 ++ trunk/src/app/srs_app_dvr.cpp | 9 +++++++++ trunk/src/core/srs_core.hpp | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f926e33a..b0cf323d5 100755 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ For previous versions, please read: ## V3 changes +* v3.0, 2020-01-25, Fix [#1108][bug #1108], reap DVR tmp file when unpublish. 3.0.106 * v3.0, 2020-01-21, [3.0 alpha9(3.0.105)][r3.0a9] released. 121577 lines. * v3.0, 2020-01-21, Fix [#1221][bug #1221], remove complex configure options. 3.0.104 * v3.0, 2020-01-21, Fix [#1547][bug #1547], support crossbuild for ARM/MIPS. @@ -1610,6 +1611,7 @@ Winlin [bug #1580]: https://github.com/ossrs/srs/issues/1580 [bug #1547]: https://github.com/ossrs/srs/issues/1547 [bug #1221]: https://github.com/ossrs/srs/issues/1221 +[bug #1108]: https://github.com/ossrs/srs/issues/1108 [bug #xxxxxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxxxxx [exo #828]: https://github.com/google/ExoPlayer/pull/828 diff --git a/trunk/src/app/srs_app_dvr.cpp b/trunk/src/app/srs_app_dvr.cpp index 507956aed..aca14581a 100644 --- a/trunk/src/app/srs_app_dvr.cpp +++ b/trunk/src/app/srs_app_dvr.cpp @@ -813,7 +813,16 @@ srs_error_t SrsDvrSegmentPlan::on_publish() 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; } srs_error_t SrsDvrSegmentPlan::on_audio(SrsSharedPtrMessage* shared_audio, SrsFormat* format) diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 732f4b120..2bca91cdf 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -27,7 +27,7 @@ // The version config. #define VERSION_MAJOR 3 #define VERSION_MINOR 0 -#define VERSION_REVISION 105 +#define VERSION_REVISION 106 // The macros generated by configure script. #include