mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
fixed issue #2874, thanks quxiaohui-debug
This commit is contained in:
parent
75a3132964
commit
9bf48567b2
@ -89,7 +89,7 @@ bool RtcMediaSourceMuxer::inputFrame(const Frame::Ptr &frame)
|
||||
addTrack(track);
|
||||
if (!_audio_dec) return false;
|
||||
}
|
||||
if (readerCount()) {
|
||||
if (readerCount() || !_regist) {
|
||||
_audio_dec->inputFrame(frame, true, false);
|
||||
if (!_count)
|
||||
InfoL << "start transcode " << frame->getCodecName() << "," << frame->pts() << "->Opus";
|
||||
@ -108,6 +108,11 @@ bool RtcMediaSourceMuxer::inputFrame(const Frame::Ptr &frame)
|
||||
}
|
||||
|
||||
#if defined(ENABLE_FFMPEG)
|
||||
void RtcMediaSourceMuxer::onRegist(MediaSource &sender, bool regist)
|
||||
{
|
||||
MediaSourceEventInterceptor::onRegist(sender, regist);
|
||||
_regist = regist;
|
||||
}
|
||||
|
||||
bool RtcMediaSourceMuxer::addTrack(const Track::Ptr & track)
|
||||
{
|
||||
|
@ -46,11 +46,13 @@ public:
|
||||
#if defined(ENABLE_FFMPEG)
|
||||
~RtcMediaSourceMuxer() override{resetTracks();}
|
||||
|
||||
void onRegist(MediaSource &sender, bool regist) override;
|
||||
bool addTrack(const Track::Ptr & track) override;
|
||||
void resetTracks() override;
|
||||
|
||||
private:
|
||||
int _count = 0;
|
||||
bool _regist = false;
|
||||
std::shared_ptr<FFmpegDecoder> _audio_dec;
|
||||
std::shared_ptr<FFmpegEncoder> _audio_enc;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user