mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
avoid loopback ffmpeg push stream exit receive deleteStream message after broken pipe
This commit is contained in:
parent
f96da3d166
commit
87dd1c7f7f
@ -50,7 +50,7 @@ void RtmpSession::onError(const SockException& err) {
|
||||
_push_src_ownership = nullptr;
|
||||
//延时10秒注销流
|
||||
auto push_src = std::move(_push_src);
|
||||
getPoller()->doDelayTask(_continue_push_ms, [push_src]() { return 0; });
|
||||
_delay_unregister_task = getPoller()->doDelayTask(_continue_push_ms, [push_src]() { return 0; });
|
||||
}
|
||||
}
|
||||
|
||||
@ -223,6 +223,10 @@ void RtmpSession::onCmd_deleteStream(AMFDecoder &dec) {
|
||||
"code", "NetStream.Unpublish.Success",
|
||||
"description", "Stop publishing." });
|
||||
//_push_src = nullptr;
|
||||
//TraceL<<" delete stream";
|
||||
if(_delay_unregister_task){
|
||||
_delay_unregister_task->cancel();
|
||||
}
|
||||
throw std::runtime_error(StrPrinter << "Stop publishing" << endl);
|
||||
}
|
||||
|
||||
|
@ -103,6 +103,8 @@ private:
|
||||
std::weak_ptr<RtmpMediaSource> _play_src;
|
||||
AMFValue _push_metadata;
|
||||
RtmpMediaSourceImp::Ptr _push_src;
|
||||
//延迟注销任务
|
||||
toolkit::EventPoller::DelayTask::Ptr _delay_unregister_task;
|
||||
std::shared_ptr<void> _push_src_ownership;
|
||||
RtmpMediaSource::RingType::RingReader::Ptr _ring_reader;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user