From 38e05ab8cb7bae8dc452c5545f3489d57ebe593f Mon Sep 17 00:00:00 2001 From: lijin <34806114+1461521844lijin@users.noreply.github.com> Date: Mon, 24 Apr 2023 14:32:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0addStreamProxy=E5=AF=B9?= =?UTF-8?q?=E9=9D=9E=E6=B3=95url=E5=BC=82=E5=B8=B8=E6=8D=95=E8=8E=B7?= =?UTF-8?q?=E5=A4=84=E7=90=86=20(#2412)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 确保抛出异常时,原有代理拉流对象被正常移除,后续可以更新正确url --- src/Player/PlayerProxy.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Player/PlayerProxy.cpp b/src/Player/PlayerProxy.cpp index 5927d441..521c38e8 100644 --- a/src/Player/PlayerProxy.cpp +++ b/src/Player/PlayerProxy.cpp @@ -100,7 +100,13 @@ void PlayerProxy::play(const string &strUrlTmp) { strongSelf->_on_close(err); } }); - MediaPlayer::play(strUrlTmp); + try { + MediaPlayer::play(strUrlTmp); + } catch (std::exception &ex) { + ErrorL << ex.what(); + _on_play_result(SockException(Err_other, ex.what())); + return; + } _pull_url = strUrlTmp; setDirectProxy(); }