From 7bf03ef2ba3b57dcc13408f1cc929dc37a97403f Mon Sep 17 00:00:00 2001 From: Xiaoniu Date: Mon, 28 Jun 2021 07:25:25 +0800 Subject: [PATCH] Fix #2068, losing of last HLS ts file 4.0.133 fix bug: last segment of ts not trigger 'on_hls', because of 'on_unpublish' earlier than 'segment_close' (#2438) --- CHANGELOG.md | 1 + trunk/src/app/srs_app_hls.cpp | 8 ++++---- trunk/src/core/srs_core_version4.hpp | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc8a1d569..0890e2501 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The changelog for SRS. ## SRS 4.0 Changelog +* v4.0, 2021-06-28, Merge [#2438](https://github.com/ossrs/srs/pull/2438), fix losing of last HLS ts file 4.0.133 * v4.0, 2021-06-27, Squash for [#2424](https://github.com/ossrs/srs/issues/2424), query the latest available version. 4.0.132 * v4.0, 2021-06-24, Merge [#2429](https://github.com/ossrs/srs/pull/2429) to fix SRT bug. 4.0.131 * v4.0, 2021-06-21, Fix [#2413](https://github.com/ossrs/srs/issues/2413), fix RTMP to RTC bug 4.0.130 diff --git a/trunk/src/app/srs_app_hls.cpp b/trunk/src/app/srs_app_hls.cpp index e035b67af..144045064 100644 --- a/trunk/src/app/srs_app_hls.cpp +++ b/trunk/src/app/srs_app_hls.cpp @@ -923,10 +923,6 @@ srs_error_t SrsHlsController::on_unpublish() { srs_error_t err = srs_success; - if ((err = muxer->on_unpublish()) != srs_success) { - return srs_error_wrap(err, "muxer unpublish"); - } - if ((err = muxer->flush_audio(tsmc)) != srs_success) { return srs_error_wrap(err, "hls: flush audio"); } @@ -934,6 +930,10 @@ srs_error_t SrsHlsController::on_unpublish() if ((err = muxer->segment_close()) != srs_success) { return srs_error_wrap(err, "hls: segment close"); } + + if ((err = muxer->on_unpublish()) != srs_success) { + return srs_error_wrap(err, "muxer unpublish"); + } return err; } diff --git a/trunk/src/core/srs_core_version4.hpp b/trunk/src/core/srs_core_version4.hpp index 139fb2cfa..4d44e09cc 100644 --- a/trunk/src/core/srs_core_version4.hpp +++ b/trunk/src/core/srs_core_version4.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 4 #define VERSION_MINOR 0 -#define VERSION_REVISION 132 +#define VERSION_REVISION 133 #endif