Fix build with HAVE_MMAL

This commit is contained in:
Cameron Gutman 2022-04-02 16:16:40 -05:00
parent a56cb0e88a
commit 09ed82db65

View File

@ -762,10 +762,15 @@ bool FFmpegVideoDecoder::tryInitializeRendererForDecoderByName(const char *decod
// HACK: Avoid using YUV420P on h264_mmal. It can cause a deadlock inside the MMAL libraries.
// Even if it didn't completely deadlock us, the performance would likely be atrocious.
if (strcmp(decoderName, "h264_mmal") == 0) {
TRY_PREFERRED_PIXEL_FORMAT(MmalRenderer);
TRY_SUPPORTED_NON_PREFERRED_PIXEL_FORMAT(MmalRenderer);
for (int i = 0; decoder->pix_fmts[i] != AV_PIX_FMT_NONE; i++) {
TRY_PREFERRED_PIXEL_FORMAT(MmalRenderer);
}
// Give up if we can't use MmalRenderer
for (int i = 0; decoder->pix_fmts[i] != AV_PIX_FMT_NONE; i++) {
TRY_SUPPORTED_NON_PREFERRED_PIXEL_FORMAT(MmalRenderer);
}
// Give up if we can't use MmalRenderer for h264_mmal
return false;
}
#endif