summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Srebrny <piotr.srebrny@qt.io>2022-05-24 09:44:16 +0200
committerPiotr Srebrny <piotr.srebrny@qt.io>2022-05-24 10:44:04 +0200
commit98e9c47020183b79c64dd30b1481c92c2e5dc01c (patch)
tree90861948ecb764e9a99f5a987f516782466bc74d
parentb8f3d45d9fdcc6059bd45fb3d9f791da1956dd28 (diff)
Fix compilation error on Windows caused by switch with only default case
Change-Id: I5a44923f78f0f5f842915a5d377c7db4d57a0acd Reviewed-by: Samuel Mira <samuel.mira@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp b/src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp
index 318db4186..91d1dbcdb 100644
--- a/src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp
+++ b/src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp
@@ -246,9 +246,10 @@ AVPixelFormat HWAccel::hwFormat() const
const AVCodec *HWAccel::hardwareDecoderForCodecId(AVCodecID id)
{
+ const AVCodec *codec = nullptr;
+#ifdef Q_OS_ANDROID
const auto getDecoder = [](AVCodecID id) {
switch (id) {
-#ifdef Q_OS_ANDROID
case AV_CODEC_ID_H264:
return avcodec_find_decoder_by_name("h264_mediacodec");
case AV_CODEC_ID_HEVC:
@@ -261,16 +262,14 @@ const AVCodec *HWAccel::hardwareDecoderForCodecId(AVCodecID id)
return avcodec_find_decoder_by_name("vp8_mediacodec");
case AV_CODEC_ID_VP9:
return avcodec_find_decoder_by_name("vp9_mediacodec");
-#endif
default:
return avcodec_find_decoder(id);
}
};
+ codec = getDecoder(id);
+#endif
- const auto *codec = getDecoder(id);
-
- // only if ffmpeg build was not setup properly
- if (Q_UNLIKELY(!codec))
+ if (!codec)
codec = avcodec_find_decoder(id);
return codec;