mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +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) {
|
else if (frame->getTrackType() == TrackAudio) {
|
||||||
if (rtmp) {
|
if (rtmp) {
|
||||||
if (_audio_dec && rtmp->readerCount())
|
if (_audio_dec && (rtmp->readerCount() || !rtmp->isRegisted()))
|
||||||
_audio_dec->inputFrame(frame, true, false, false);
|
_audio_dec->inputFrame(frame, true, false, false);
|
||||||
rtmp = nullptr;
|
rtmp = nullptr;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,11 @@ public:
|
|||||||
int readerCount() const{
|
int readerCount() const{
|
||||||
return _media_src->readerCount();
|
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 {
|
void addTrackCompleted() override {
|
||||||
RtmpMuxer::addTrackCompleted();
|
RtmpMuxer::addTrackCompleted();
|
||||||
makeConfigPacket();
|
makeConfigPacket();
|
||||||
@ -76,6 +80,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool _enabled = true;
|
bool _enabled = true;
|
||||||
|
bool _is_registed = false;
|
||||||
bool _clear_cache = false;
|
bool _clear_cache = false;
|
||||||
ProtocolOption _option;
|
ProtocolOption _option;
|
||||||
RtmpMediaSource::Ptr _media_src;
|
RtmpMediaSource::Ptr _media_src;
|
||||||
|
Loading…
Reference in New Issue
Block a user