diff --git a/src/Common/MultiMediaSourceMuxer.cpp b/src/Common/MultiMediaSourceMuxer.cpp index 73f47d80..82a3999b 100644 --- a/src/Common/MultiMediaSourceMuxer.cpp +++ b/src/Common/MultiMediaSourceMuxer.cpp @@ -187,9 +187,9 @@ bool MultiMediaSourceMuxer::setupRecord(MediaSource &sender, Recorder::type type bool MultiMediaSourceMuxer::isRecording(MediaSource &sender, Recorder::type type) { switch (type){ case Recorder::type_hls : - return _hls ? true : false; + return !!_hls; case Recorder::type_mp4 : - return _mp4 ? true : false; + return !!_mp4; default: return false; } diff --git a/src/Rtsp/RtspSession.cpp b/src/Rtsp/RtspSession.cpp index edb9a104..9cb16b41 100644 --- a/src/Rtsp/RtspSession.cpp +++ b/src/Rtsp/RtspSession.cpp @@ -259,10 +259,11 @@ void RtspSession::handleReq_ANNOUNCE(const Parser &parser) { for (auto &track : _sdp_track) { _rtcp_context.emplace_back(std::make_shared()); } - _push_src = std::make_shared(_media_info._vhost, _media_info._app, _media_info._streamid); - _push_src->setListener(dynamic_pointer_cast(shared_from_this())); - _push_src->setProtocolTranslation(enableHls, enableMP4); - _push_src->setSdp(parser.Content()); + auto push_src = std::make_shared(_media_info._vhost, _media_info._app, _media_info._streamid); + push_src->setListener(dynamic_pointer_cast(shared_from_this())); + push_src->setProtocolTranslation(enableHls, enableMP4); + push_src->setSdp(parser.Content()); + _push_src = std::move(push_src); sendRtspResponse("200 OK"); }; diff --git a/src/Rtsp/RtspSession.h b/src/Rtsp/RtspSession.h index d9caf1b1..9911b0d4 100644 --- a/src/Rtsp/RtspSession.h +++ b/src/Rtsp/RtspSession.h @@ -185,7 +185,7 @@ private: //url解析后保存的相关信息 MediaInfo _media_info; //rtsp推流相关绑定的源 - RtspMediaSourceImp::Ptr _push_src; + RtspMediaSource::Ptr _push_src; //rtsp播放器绑定的直播源 std::weak_ptr _play_src; //直播源读取器