mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-26 03:42:21 +08:00
onNoneReader事件避免重复触发
This commit is contained in:
@@ -1089,7 +1089,8 @@ inline int RtspSession::getTrackIndexByInterleaved(int interleaved){
|
||||
}
|
||||
|
||||
bool RtspSession::close(MediaSource &sender,bool force) {
|
||||
if(!force && _pushSrc->readerCount() != 0){
|
||||
//此回调在其他线程触发
|
||||
if(!_pushSrc || (!force && _pushSrc->readerCount() != 0)){
|
||||
return false;
|
||||
}
|
||||
string err = StrPrinter << "close media:" << sender.getSchema() << "/" << sender.getVhost() << "/" << sender.getApp() << "/" << sender.getId() << " " << force;
|
||||
@@ -1098,6 +1099,15 @@ bool RtspSession::close(MediaSource &sender,bool force) {
|
||||
}
|
||||
|
||||
|
||||
void RtspSession::onNoneReader(MediaSource &sender){
|
||||
//此回调在其他线程触发
|
||||
if(!_pushSrc || _pushSrc->readerCount() != 0){
|
||||
return;
|
||||
}
|
||||
MediaSourceEvent::onNoneReader(sender);
|
||||
}
|
||||
|
||||
|
||||
inline void RtspSession::sendRtpPacket(const RtpPacket::Ptr & pkt) {
|
||||
//InfoP(this) <<(int)pkt.Interleaved;
|
||||
switch (_rtpType) {
|
||||
|
||||
Reference in New Issue
Block a user