anyrtcIO-Community / anyRTC-RTMP-OpenSource

RTMP 推流器,RTMP(HLS)秒开播放器,直播点播,跨平台(Win,IOS,Android)开源代码
https://www.anyrtc.io
GNU General Public License v3.0
4.68k stars 1.61k forks source link

播放流结束,退出时会偶现崩溃问题 #100

Open krislyy opened 6 years ago

krislyy commented 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]()

DyncEric commented 6 years ago

好的。感谢