From e5fe27a167ae60fd12a1ac3344be70af8d484cf6 Mon Sep 17 00:00:00 2001 From: Norihiro Kamae Date: Tue, 5 Sep 2023 22:35:23 +0900 Subject: [PATCH] win-dshow: Log source name at error When a user has multiple win-dshow inputs, it's hard to identify the input outputting errors in a log file. --- plugins/win-dshow/win-dshow.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/win-dshow/win-dshow.cpp b/plugins/win-dshow/win-dshow.cpp index ffce6e599..fcd3c8ed7 100644 --- a/plugins/win-dshow/win-dshow.cpp +++ b/plugins/win-dshow/win-dshow.cpp @@ -501,7 +501,9 @@ void DShowInput::OnEncodedVideoData(enum AVCodecID id, unsigned char *data, if (!ffmpeg_decode_valid(video_decoder)) { if (ffmpeg_decode_init(video_decoder, id, hw_decode) < 0) { - blog(LOG_WARNING, "Could not initialize video decoder"); + blog(LOG_WARNING, + "%s: Could not initialize video decoder", + obs_source_get_name(source)); return; } } @@ -510,7 +512,8 @@ void DShowInput::OnEncodedVideoData(enum AVCodecID id, unsigned char *data, bool success = ffmpeg_decode_video(video_decoder, data, size, &ts, cs, frame.range, &frame, &got_output); if (!success) { - blog(LOG_WARNING, "Error decoding video"); + blog(LOG_WARNING, "%s: Error decoding video", + obs_source_get_name(source)); return; } @@ -633,7 +636,9 @@ void DShowInput::OnEncodedAudioData(enum AVCodecID id, unsigned char *data, { if (!ffmpeg_decode_valid(audio_decoder)) { if (ffmpeg_decode_init(audio_decoder, id, false) < 0) { - blog(LOG_WARNING, "Could not initialize audio decoder"); + blog(LOG_WARNING, + "%s: Could not initialize audio decoder", + obs_source_get_name(source)); return; } } @@ -643,7 +648,8 @@ void DShowInput::OnEncodedAudioData(enum AVCodecID id, unsigned char *data, bool success = ffmpeg_decode_audio(audio_decoder, data, size, &audio, &got_output); if (!success) { - blog(LOG_WARNING, "Error decoding audio"); + blog(LOG_WARNING, "%s: Error decoding audio", + obs_source_get_name(source)); return; }