From c97aa8483e78f0e1506b5da82b7b827f0e22a78e Mon Sep 17 00:00:00 2001 From: joshuafc Date: Thu, 27 Jan 2022 14:56:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E8=B0=83=E7=94=A8mk=5Fmedia=5Fsource?= =?UTF-8?q?=5Fclose(ptr,=201);=E6=97=B6=EF=BC=8C=E4=B8=BB=E5=8A=A8?= =?UTF-8?q?=E6=B3=A8=E9=94=80=E6=B5=81=20(#1401)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 当调用mk_media_source_close(ptr, 1);时,主动注销流 主动调用上述函数时,期望不再等待RtmpSession.cpp:49处getPoller()->doDelayTask(continue_push_ms, [push_src]() { return 0; });捕获的指针,等待析构时反注册,而是立即反注册。 * `MediaSource::close`逻辑执行成功后执行`unregist` --- src/Common/MediaSource.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Common/MediaSource.cpp b/src/Common/MediaSource.cpp index 8583f114..4cd5f90f 100644 --- a/src/Common/MediaSource.cpp +++ b/src/Common/MediaSource.cpp @@ -208,7 +208,7 @@ bool MediaSource::close(bool force) { if(!listener){ return false; } - return listener->close(*this,force); + return listener->close(*this,force) && unregist(); } void MediaSource::onReaderChanged(int size) {