anyRTC-RTMP-OpenSource
anyRTC-RTMP-OpenSource copied to clipboard
播放流结束,退出时会偶现崩溃问题
在结束拉流的时候回偶现崩溃,定位到的代码是void RtmpGuesterImpl::StopRtmpPlay() { if (av_rtmp_started_) { av_rtmp_started_ = false; rtmp_url_ = ""; webrtc::AnyRtmpCore::Inst().StopAudioTrack(); av_rtmp_player_->StopPlay(); _if (video_render_ != NULL) { delete video_render_; video_render_ = NULL; }_ } }
将斜线部分代码使用智能指针代替,问题得到了解决。rtc::scoped_ptrwebrtc::VideoRenderer video_render_; 问题主要是析构时,多线程使用video_render_引起的。
具体修改方法可看我fork的地址:https://github.com/liuyy1989/anyRTC-RTMP-OpenSource
好的。感谢