Check FindDecoder result in GIFs renderer.

This commit is contained in:
John Preston 2023-02-03 09:22:44 +04:00
parent 2dd01ed09f
commit 5f027d7c87

View file

@ -335,6 +335,10 @@ bool FFMpegReaderImplementation::start(Mode mode, crl::time &positionMs) {
av_opt_set_int(_codecContext, "refcounted_frames", 1, 0);
const auto codec = FFmpeg::FindDecoder(_codecContext);
if (!codec) {
LOG(("Gif Error: Unable to avcodec_find_decoder %1").arg(logData()));
return false;
}
if (_mode == Mode::Inspecting) {
const auto audioStreamId = av_find_best_stream(_fmtContext, AVMEDIA_TYPE_AUDIO, -1, -1, nullptr, 0);
_hasAudioStream = (audioStreamId >= 0);