diff --git a/src/Common/MediaSource.cpp b/src/Common/MediaSource.cpp index 8b7a1b61..f1f210bd 100644 --- a/src/Common/MediaSource.cpp +++ b/src/Common/MediaSource.cpp @@ -67,12 +67,12 @@ ProtocolOption::ProtocolOption() { ////////////////////////////////////////////////////////////////////////////////////////////////////////////// struct MediaSourceNull : public MediaSource { - MediaSourceNull(const MediaTuple &tuple) : MediaSource("schema", tuple) {}; + MediaSourceNull() : MediaSource("schema", MediaTuple{"vhost", "app", "stream", ""}) {}; int readerCount() override { return 0; } }; -MediaSource &MediaSource::NullMediaSource(const MediaTuple &tuple) { - static std::shared_ptr s_null = std::make_shared(tuple); +MediaSource &MediaSource::NullMediaSource() { + static std::shared_ptr s_null = std::make_shared(); return *s_null; } diff --git a/src/Common/MediaSource.h b/src/Common/MediaSource.h index 621c859e..fc7f77d2 100644 --- a/src/Common/MediaSource.h +++ b/src/Common/MediaSource.h @@ -397,8 +397,7 @@ bool equalMediaTuple(const MediaTuple& a, const MediaTuple& b); */ class MediaSource: public TrackSource, public std::enable_shared_from_this { public: - static MediaSource &NullMediaSource(const MediaTuple &tuple = {"vhost", "app", "stream" }); - + static MediaSource& NullMediaSource(); using Ptr = std::shared_ptr; MediaSource(const std::string &schema, const MediaTuple& tuple); diff --git a/src/Common/MultiMediaSourceMuxer.cpp b/src/Common/MultiMediaSourceMuxer.cpp index 43645abc..c3985615 100644 --- a/src/Common/MultiMediaSourceMuxer.cpp +++ b/src/Common/MultiMediaSourceMuxer.cpp @@ -319,7 +319,7 @@ bool MultiMediaSourceMuxer::setupRecord(Recorder::type type, bool start, const s if (_option.mp4_as_player && type == Recorder::type_mp4) { // 开启关闭mp4录制,触发观看人数变化相关事件 [AUTO-TRANSLATED:b63a8deb] // Turn on/off mp4 recording, trigger events related to changes in the number of viewers - onReaderChanged(MediaSource::NullMediaSource(_tuple), totalReaderCount()); + onReaderChanged(MediaSource::NullMediaSource(), totalReaderCount()); } }); switch (type) {