修复addFFmpegSource接口线程检测失败相关bug (#4225 #4233)

This commit is contained in:
xiongguangjie 2025-04-09 21:33:12 +08:00 committed by GitHub
parent fd4f00dd63
commit 026e74d624
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -341,10 +341,14 @@ void FFmpegSource::onGetMediaSource(const MediaSource::Ptr &src) {
setDelegate(listener); setDelegate(listener);
muxer->setDelegate(shared_from_this()); muxer->setDelegate(shared_from_this());
if (_enable_hls) { if (_enable_hls) {
src->setupRecord(Recorder::type_hls, true, "", 0); src->getOwnerPoller()->async([=]() mutable {
src->setupRecord(Recorder::type_hls, true, "", 0);
});
} }
if (_enable_mp4) { if (_enable_mp4) {
src->setupRecord(Recorder::type_mp4, true, "", 0); src->getOwnerPoller()->async([=]() mutable {
src->setupRecord(Recorder::type_mp4, true, "", 0);
});
} }
} }
} }