diff --git a/src/Common/MultiMediaSourceMuxer.cpp b/src/Common/MultiMediaSourceMuxer.cpp index 235c6ea4..565bd266 100644 --- a/src/Common/MultiMediaSourceMuxer.cpp +++ b/src/Common/MultiMediaSourceMuxer.cpp @@ -200,6 +200,12 @@ int MultiMediaSourceMuxer::totalReaderCount(MediaSource &sender) { //此函数可能跨线程调用 bool MultiMediaSourceMuxer::setupRecord(MediaSource &sender, Recorder::type type, bool start, const string &custom_path, size_t max_second) { + onceToken token(nullptr, [&]() { + if (_option.mp4_as_player && type == Recorder::type_mp4) { + //开启关闭mp4录制,触发观看人数变化相关事件 + onReaderChanged(sender, totalReaderCount()); + } + }); switch (type) { case Recorder::type_hls : { if (start && !_hls) {