소스 검색

obs-ffmpeg: Don't preload media frames if set to pause on end

Preloading is designed to overwrite the current internal render texture
of the source so it'll be ready to play the first frame right when the
source is first displayed.

However, When the media source is set to pause on the last frame, it
keeps that current render texture visible, so preloading it with the
first frame will essentially overwrite the current render, causing it to
inadvertently show and pause on the first frame rather than the last
frame.  So instead, just disable preloading when the user has it set to
pause on the last frame.
jp9000 8 년 전
부모
커밋
054148a0af
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      plugins/obs-ffmpeg/obs-ffmpeg-source.c

+ 2 - 1
plugins/obs-ffmpeg/obs-ffmpeg-source.c

@@ -218,7 +218,8 @@ static void get_frame(void *opaque, struct obs_source_frame *f)
 static void preload_frame(void *opaque, struct obs_source_frame *f)
 {
 	struct ffmpeg_source *s = opaque;
-	obs_source_preload_video(s->source, f);
+	if (s->is_clear_on_media_end || s->is_looping)
+		obs_source_preload_video(s->source, f);
 }
 
 static void get_audio(void *opaque, struct obs_source_audio *a)