diff --git a/src/media/video/accel.cpp b/src/media/video/accel.cpp index c043d7153a79196aa5e588f3523a0949c5b927de..a28c7b2f7f3844f3adf4c2195a8285b5cceeb363 100644 --- a/src/media/video/accel.cpp +++ b/src/media/video/accel.cpp @@ -41,13 +41,17 @@ getFormatCb(AVCodecContext* codecCtx, const AVPixelFormat* formats) AVPixelFormat fallback = AV_PIX_FMT_NONE; for (int i = 0; formats[i] != AV_PIX_FMT_NONE; ++i) { fallback = formats[i]; - if (formats[i] == accel->format) { + if (accel && formats[i] == accel->format) { return formats[i]; } } - RING_WARN("'%s' acceleration not supported, falling back to software decoding", accel->name.c_str()); - accel->name = {}; // don't use accel + if (accel) { + RING_WARN("'%s' acceleration not supported, falling back to software decoding", accel->name.c_str()); + accel->name = {}; // don't use accel + } else { + RING_WARN() << "Not using hardware decoding"; + } return fallback; }