aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-10-07 13:19:32 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2016-10-07 13:19:32 +0200
commit5e872d908368e7a246f37e28df1f67e8c4fb08b9 (patch)
tree33de25f435e0982f6fd8d41c112fc4cd7fa04514
parent40b2878ad3bb12d91b15a7278b6a8862c09f4d54 (diff)
parent11b8030309ee93d79b3a6cd4b83bf00757db1598 (diff)
downloadffmpeg-5e872d908368e7a246f37e28df1f67e8c4fb08b9.tar.gz
Merge commit '11b8030309ee93d79b3a6cd4b83bf00757db1598'
* commit '11b8030309ee93d79b3a6cd4b83bf00757db1598': vaapi_encode: Fix fallback when input does not match any format Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
-rw-r--r--libavcodec/vaapi_encode.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 8c9a3bda3b..21a86568fa 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -1114,8 +1114,11 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx,
break;
}
}
- if (recon_format == AV_PIX_FMT_NONE)
- recon_format = constraints->valid_sw_formats[i];
+ if (recon_format == AV_PIX_FMT_NONE) {
+ // No match. Just use the first in the supported list and
+ // hope for the best.
+ recon_format = constraints->valid_sw_formats[0];
+ }
} else {
// No idea what to use; copy input format.
recon_format = ctx->input_frames->sw_format;