From 0afe75229e30b5d4729a2f49c29aa8b75d78fe70 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Sat, 13 May 2023 00:02:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8B=89=E6=B5=81=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E8=8E=B7=E5=8F=96=E6=B5=81=E4=BF=A1=E6=81=AF=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E8=AE=BF=E9=97=AE=E7=A9=BA=E6=8C=87=E9=92=88=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 此bug由 #2448 引入,触发条件: - 1.配置文件rtsp.directProxy设置为0 - 2.调用addStreamProxy代理rtsp流 在非直接代理情况下,PlayerProxy::_media_src为空,导致访问空指针。 --- src/Player/PlayerProxy.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Player/PlayerProxy.cpp b/src/Player/PlayerProxy.cpp index 289c7249..5bdb3083 100644 --- a/src/Player/PlayerProxy.cpp +++ b/src/Player/PlayerProxy.cpp @@ -65,8 +65,8 @@ void PlayerProxy::setOnConnect(std::function cb) { void PlayerProxy::setTranslationInfo() { - _transtalion_info.byte_speed = _media_src->getBytesSpeed(); - _transtalion_info.start_time_stamp = _media_src->getCreateStamp(); + _transtalion_info.byte_speed = _media_src ? _media_src->getBytesSpeed() : -1; + _transtalion_info.start_time_stamp = _media_src ? _media_src->getCreateStamp() : 0; _transtalion_info.stream_info.clear(); auto tracks = _muxer->getTracks(); for (auto &track : tracks) {