mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
修复只有aac的Rtmp流无法注册bug
This commit is contained in:
parent
442df29c83
commit
2adc12c4ab
@ -623,7 +623,7 @@ bool MultiMediaSourceMuxer::onTrackFrame(const Frame::Ptr &frame_in) {
|
||||
}
|
||||
else if (frame->getTrackType() == TrackAudio) {
|
||||
if (rtmp) {
|
||||
if (_audio_dec && rtmp->readerCount())
|
||||
if (_audio_dec && (rtmp->readerCount() || !rtmp->isRegisted()))
|
||||
_audio_dec->inputFrame(frame, true, false, false);
|
||||
rtmp = nullptr;
|
||||
}
|
||||
|
@ -43,7 +43,11 @@ public:
|
||||
int readerCount() const{
|
||||
return _media_src->readerCount();
|
||||
}
|
||||
|
||||
bool isRegisted() const { return _is_registed; }
|
||||
void onRegist(MediaSource& sender, bool regist) override {
|
||||
MediaSourceEventInterceptor::onRegist(sender, regist);
|
||||
_is_registed = regist;
|
||||
}
|
||||
void addTrackCompleted() override {
|
||||
RtmpMuxer::addTrackCompleted();
|
||||
makeConfigPacket();
|
||||
@ -76,6 +80,7 @@ public:
|
||||
|
||||
private:
|
||||
bool _enabled = true;
|
||||
bool _is_registed = false;
|
||||
bool _clear_cache = false;
|
||||
ProtocolOption _option;
|
||||
RtmpMediaSource::Ptr _media_src;
|
||||
|
Loading…
Reference in New Issue
Block a user