From 5b775ca5b4aad9aecb2b29e033f9df790b06d554 Mon Sep 17 00:00:00 2001 From: Sam Bazley Date: Wed, 28 Jul 2021 15:59:23 +0100 Subject: [PATCH] decoder/ffmpeg: check if long_name is not null --- src/decoder/plugins/FfmpegDecoderPlugin.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index 68b6b7b15..3dfdee94f 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -602,8 +602,12 @@ ffmpeg_decode(DecoderClient &client, InputStream &input) FfmpegOpenInput(stream.io, input.GetURI(), nullptr); const auto *input_format = format_context->iformat; - FmtDebug(ffmpeg_domain, "detected input format '{}' ({})", - input_format->name, input_format->long_name); + if (input_format->long_name == nullptr) + FmtDebug(ffmpeg_domain, "detected input format '{}'", + input_format->name); + else + FmtDebug(ffmpeg_domain, "detected input format '{}' ({})", + input_format->name, input_format->long_name); FfmpegDecode(client, &input, *format_context); } @@ -668,8 +672,12 @@ ffmpeg_uri_decode(DecoderClient &client, const char *uri) FfmpegOpenInput(nullptr, uri, nullptr); const auto *input_format = format_context->iformat; - FmtDebug(ffmpeg_domain, "detected input format '{}' ({})", - input_format->name, input_format->long_name); + if (input_format->long_name == nullptr) + FmtDebug(ffmpeg_domain, "detected input format '{}'", + input_format->name); + else + FmtDebug(ffmpeg_domain, "detected input format '{}' ({})", + input_format->name, input_format->long_name); FfmpegDecode(client, nullptr, *format_context); }