mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-27 13:49:01 +08:00
fix direct_proxy is 0 repush not success
This commit is contained in:
parent
6383e25826
commit
5792af3dd5
@ -142,6 +142,10 @@ void MultiMediaSourceMuxer::setTrackListener(const std::weak_ptr<Listener> &list
|
||||
_track_listener = listener;
|
||||
}
|
||||
|
||||
std::weak_ptr<MultiMediaSourceMuxer::Listener> MultiMediaSourceMuxer::getTrackListener(){
|
||||
return _track_listener;
|
||||
}
|
||||
|
||||
int MultiMediaSourceMuxer::totalReaderCount() const {
|
||||
auto hls = _hls;
|
||||
auto ret = (_rtsp ? _rtsp->readerCount() : 0) +
|
||||
|
@ -51,6 +51,11 @@ public:
|
||||
*/
|
||||
void setTrackListener(const std::weak_ptr<Listener> &listener);
|
||||
|
||||
/**
|
||||
* 获取Track就绪事件监听器
|
||||
*/
|
||||
std::weak_ptr<Listener> getTrackListener();
|
||||
|
||||
/**
|
||||
* 返回总的消费者个数
|
||||
*/
|
||||
|
@ -301,8 +301,26 @@ void RtspSession::handleReq_ANNOUNCE(const Parser &parser) {
|
||||
});
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
auto listener = rtsp_src->getListener(true);
|
||||
//TraceL<<toolkit::demangle(typeid(*listener.lock()).name());
|
||||
auto muxer = dynamic_pointer_cast<MultiMediaSourceMuxer>(listener.lock());
|
||||
if(muxer){
|
||||
//TraceL;
|
||||
rtsp_src_imp = dynamic_pointer_cast<RtspMediaSourceImp>(muxer->getTrackListener().lock());
|
||||
if(rtsp_src_imp){
|
||||
//TraceL;
|
||||
_push_src_ownership = rtsp_src_imp->getOwnership();
|
||||
if(_push_src_ownership){
|
||||
_push_src = std::move(rtsp_src_imp);
|
||||
onResPushSrc(option);
|
||||
return;
|
||||
}else{
|
||||
WarnL<<"not reach this";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sendRtspResponse("406 Not Acceptable", { "Content-Type", "text/plain" }, "not reach this");
|
||||
string err = StrPrinter << "ANNOUNCE: not reach this:" << _media_info.shortUrl() << endl;
|
||||
throw SockException(Err_shutdown, err);
|
||||
|
Loading…
Reference in New Issue
Block a user