修复rtsp推流服务器在udp模式下的bug

优化代码
This commit is contained in:
xiongziliang
2019-03-28 11:52:07 +08:00
parent d208f69730
commit 6045b1b8f8
7 changed files with 84 additions and 73 deletions

View File

@@ -64,12 +64,17 @@ void RtmpPusher::teardown() {
}
void RtmpPusher::onPublishResult(const SockException &ex) {
_pPublishTimer.reset();
if(_onPublished){
_onPublished(ex);
_onPublished = nullptr;
}else if(_onShutdown){
_onShutdown(ex);
if(_pPublishTimer){
//播放结果回调
_pPublishTimer.reset();
if(_onPublished){
_onPublished(ex);
}
} else {
//播放成功后异常断开回调
if(_onShutdown){
_onShutdown(ex);
}
}
if(ex){