Bläddra i källkod

obs-ffmpeg/ffmpeg-mux: Fix splitting hang on Windows

stdout on Windows from a subprocess requires that something read the
stdout buffer, and currently we don't do that. Due to newly introduced
printf/fprintf calls, the stdout buffer eventually fills up because
nothing is emptying it, thus the muxer locks up on an fprintf/printf
call and causes OBS itself to hang.
jp9000 3 år sedan
förälder
incheckning
a4c215869f
1 ändrade filer med 5 tillägg och 0 borttagningar
  1. 5 0
      plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c

+ 5 - 0
plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c

@@ -670,9 +670,12 @@ static int ffmpeg_mux_init_context(struct ffmpeg_mux *ffm)
 			ffm->params.printable_file.array);
 		return FFM_ERROR;
 	}
+
+#ifdef ENABLE_FFMPEG_MUX_DEBUG
 	printf("info: Output format name and long_name: %s, %s\n",
 	       output_format->name ? output_format->name : "unknown",
 	       output_format->long_name ? output_format->long_name : "unknown");
+#endif
 
 	ret = avformat_alloc_output_context2(&ffm->output, output_format, NULL,
 					     ffm->params.file);
@@ -835,7 +838,9 @@ static inline bool read_change_file(struct ffmpeg_mux *ffm, uint32_t size,
 	}
 	filename->buf[size] = 0;
 
+#ifdef ENABLE_FFMPEG_MUX_DEBUG
 	fprintf(stderr, "info: New output file name: %s\n", filename->buf);
+#endif
 
 	int ret;
 	char *argv1_backup = argv[1];