Open krislyy opened 6 years ago
在结束拉流的时候回偶现崩溃,定位到的代码是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_ptr videorender; 问题主要是析构时,多线程使用video_render_引起的。 具体修改方法可看我fork的地址:[https://github.com/liuyy1989/anyRTC-RTMP-OpenSource]()
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; }_ } }
好的。感谢
在结束拉流的时候回偶现崩溃,定位到的代码是 videorender; 问题主要是析构时,多线程使用video_render_引起的。
具体修改方法可看我fork的地址:[https://github.com/liuyy1989/anyRTC-RTMP-OpenSource]()
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_ptr