未验证 提交 80bb9b46 编写于 作者: J Jim 提交者: GitHub

Merge pull request #3206 from notr1ch/frame-fix-squashed

Fix preloaded video behavior
......@@ -2888,8 +2888,6 @@ obs_source_preload_video_internal(obs_source_t *source,
if (!frame)
return;
obs_enter_graphics();
if (preload_frame_changed(source, frame)) {
obs_source_frame_destroy(source->async_preload_frame);
source->async_preload_frame = obs_source_frame_create(
......@@ -2897,13 +2895,8 @@ obs_source_preload_video_internal(obs_source_t *source,
}
copy_frame_data(source->async_preload_frame, frame);
set_async_texture_size(source, source->async_preload_frame);
update_async_textures(source, source->async_preload_frame,
source->async_textures, source->async_texrender);
source->last_frame_ts = frame->timestamp;
obs_leave_graphics();
}
void obs_source_preload_video(obs_source_t *source,
......@@ -2962,8 +2955,18 @@ void obs_source_show_preloaded_video(obs_source_t *source)
if (!obs_source_valid(source, "obs_source_show_preloaded_video"))
return;
if (!source->async_preload_frame)
return;
obs_enter_graphics();
set_async_texture_size(source, source->async_preload_frame);
update_async_textures(source, source->async_preload_frame,
source->async_textures, source->async_texrender);
source->async_active = true;
obs_leave_graphics();
pthread_mutex_lock(&source->audio_buf_mutex);
sys_ts = (source->monitoring_type != OBS_MONITORING_TYPE_MONITOR_ONLY)
? os_gettime_ns()
......
......@@ -317,9 +317,10 @@ static void ffmpeg_source_start(struct ffmpeg_source *s)
return;
mp_media_play(&s->media, s->is_looping, s->reconnecting);
if (s->is_local_file)
if (s->is_local_file && (s->is_clear_on_media_end || s->is_looping))
obs_source_show_preloaded_video(s->source);
else
obs_source_output_video(s->source, NULL);
set_media_state(s, OBS_MEDIA_STATE_PLAYING);
obs_source_media_started(s->source);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册