From c53730f36c10d1d7365b0b05455e7eef4117594f Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Fri, 9 Jan 2026 11:40:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A8=E6=B5=81=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E5=A4=B1=E8=B4=A5=E6=97=A0=E9=99=90=E9=87=8D=E8=AF=95?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解决媒体注销但还保持无限重试推流的bug --- src/Pusher/PusherProxy.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Pusher/PusherProxy.cpp b/src/Pusher/PusherProxy.cpp index 742df665..fef8f9f8 100644 --- a/src/Pusher/PusherProxy.cpp +++ b/src/Pusher/PusherProxy.cpp @@ -115,7 +115,13 @@ void PusherProxy::rePublish(const string &dst_url, int failed_cnt) { return false; } WarnL << "推流重试[" << failed_cnt << "]:" << dst_url; - strong_self->MediaPusher::publish(dst_url); + try { + strong_self->MediaPusher::publish(dst_url); + } catch (std::exception &e) { + WarnL << e.what(); + // 回调推流失败,一般是媒体注销了 + strong_self->_on_close(SockException(Err_other, e.what())); + } return false; }, getPoller());