Browse Source

obs-ffmpeg/ffmpeg-mux: Fix hang without global_stream_key

If DEBUG_FFMPEG_MUX is enabled, when starting a recording without
configuring global_stream_key, obs-ffmpeg-mux will hang. Apply same
check to global_stream_key as in init_params() to prevent this.
floele 4 years ago
parent
commit
44c38e71cc
1 changed files with 3 additions and 1 deletions
  1. 3 1
      plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c

+ 3 - 1
plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c

@@ -237,7 +237,9 @@ static void ffmpeg_log_callback(void *param, int level, const char *format,
 
 	vsnprintf(out_buffer, sizeof(out_buffer), format, args);
 	dstr_copy(&out, out_buffer);
-	dstr_replace(&out, global_stream_key, "{stream_key}");
+	if (global_stream_key && *global_stream_key) {
+		dstr_replace(&out, global_stream_key, "{stream_key}");
+	}
 
 	switch (level) {
 	case AV_LOG_INFO: