mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-19 00:07:49 +08:00
修复mp4_as_player设置为1时,on_stream_none_reader回调无效流信息的问题 (#4725)
This commit is contained in:
parent
a85db32223
commit
6f9531c5fa
@ -67,12 +67,12 @@ ProtocolOption::ProtocolOption() {
|
|||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
struct MediaSourceNull : public MediaSource {
|
struct MediaSourceNull : public MediaSource {
|
||||||
MediaSourceNull() : MediaSource("schema", MediaTuple{"vhost", "app", "stream", ""}) {};
|
MediaSourceNull(const MediaTuple &tuple) : MediaSource("schema", tuple) {};
|
||||||
int readerCount() override { return 0; }
|
int readerCount() override { return 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
MediaSource &MediaSource::NullMediaSource() {
|
MediaSource &MediaSource::NullMediaSource(const MediaTuple &tuple) {
|
||||||
static std::shared_ptr<MediaSource> s_null = std::make_shared<MediaSourceNull>();
|
static std::shared_ptr<MediaSource> s_null = std::make_shared<MediaSourceNull>(tuple);
|
||||||
return *s_null;
|
return *s_null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -397,7 +397,8 @@ bool equalMediaTuple(const MediaTuple& a, const MediaTuple& b);
|
|||||||
*/
|
*/
|
||||||
class MediaSource: public TrackSource, public std::enable_shared_from_this<MediaSource> {
|
class MediaSource: public TrackSource, public std::enable_shared_from_this<MediaSource> {
|
||||||
public:
|
public:
|
||||||
static MediaSource& NullMediaSource();
|
static MediaSource &NullMediaSource(const MediaTuple &tuple = {"vhost", "app", "stream" });
|
||||||
|
|
||||||
using Ptr = std::shared_ptr<MediaSource>;
|
using Ptr = std::shared_ptr<MediaSource>;
|
||||||
|
|
||||||
MediaSource(const std::string &schema, const MediaTuple& tuple);
|
MediaSource(const std::string &schema, const MediaTuple& tuple);
|
||||||
|
|||||||
@ -319,7 +319,7 @@ bool MultiMediaSourceMuxer::setupRecord(Recorder::type type, bool start, const s
|
|||||||
if (_option.mp4_as_player && type == Recorder::type_mp4) {
|
if (_option.mp4_as_player && type == Recorder::type_mp4) {
|
||||||
// 开启关闭mp4录制,触发观看人数变化相关事件 [AUTO-TRANSLATED:b63a8deb]
|
// 开启关闭mp4录制,触发观看人数变化相关事件 [AUTO-TRANSLATED:b63a8deb]
|
||||||
// Turn on/off mp4 recording, trigger events related to changes in the number of viewers
|
// Turn on/off mp4 recording, trigger events related to changes in the number of viewers
|
||||||
onReaderChanged(MediaSource::NullMediaSource(), totalReaderCount());
|
onReaderChanged(MediaSource::NullMediaSource(_tuple), totalReaderCount());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user