From 44c38e71ccdbf9459286925b3a770452dc56488d Mon Sep 17 00:00:00 2001 From: floele Date: Sun, 21 Mar 2021 08:54:57 +0100 Subject: [PATCH] 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. --- plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c b/plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c index 368877e60..72763d814 100644 --- a/plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c +++ b/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: