summaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2016-06-18 13:05:23 +0100
committerMark Thompson <sw@jkqxz.net>2016-06-21 20:42:22 +0100
commit11b8030309ee93d79b3a6cd4b83bf00757db1598 (patch)
tree04b15abe4f8e3333e3dd35c1c8d9c04973c79ff8 /libavcodec
parent8c3c7b8920033d61c7aa15a4465b759c84e5958f (diff)
downloadffmpeg-streaming-11b8030309ee93d79b3a6cd4b83bf00757db1598.zip
ffmpeg-streaming-11b8030309ee93d79b3a6cd4b83bf00757db1598.tar.gz
vaapi_encode: Fix fallback when input does not match any format
Just a typo. Add a comment to make it clearer what it's doing.
Diffstat (limited to 'libavcodec')
-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 45f5e57..c3f4e44 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;
OpenPOWER on IntegriCloud