summaryrefslogtreecommitdiff
path: root/libavcodec/v4l2_m2m_enc.c
diff options
context:
space:
mode:
authorAndriy Gelman <andriy.gelman@gmail.com>2020-01-12 23:11:27 -0500
committerMark Thompson <sw@jkqxz.net>2020-02-01 21:39:05 +0000
commit4c1a3e91665c102136ded4a78310166e9eb99604 (patch)
tree3a631584b6ae3bc9ee44dfaafd6205cb128cd81a /libavcodec/v4l2_m2m_enc.c
parent3905ecbc0670377e768cecf9a5e9be397b7a4e5a (diff)
avcodec/v4l2_m2m: Simplify capture buffer init check
Before this commit s->avctx == NULL was used to infer that an encoder is being initialzed. Code readability has been improved by directly using !av_codec_is_decoder() instead. Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Diffstat (limited to 'libavcodec/v4l2_m2m_enc.c')
-rw-r--r--libavcodec/v4l2_m2m_enc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
index 8059e3bb48..98b9dfc2c0 100644
--- a/libavcodec/v4l2_m2m_enc.c
+++ b/libavcodec/v4l2_m2m_enc.c
@@ -312,12 +312,12 @@ static av_cold int v4l2_encode_init(AVCodecContext *avctx)
capture->av_codec_id = avctx->codec_id;
capture->av_pix_fmt = AV_PIX_FMT_NONE;
+ s->avctx = avctx;
ret = ff_v4l2_m2m_codec_init(priv);
if (ret) {
av_log(avctx, AV_LOG_ERROR, "can't configure encoder\n");
return ret;
}
- s->avctx = avctx;
if (V4L2_TYPE_IS_MULTIPLANAR(output->type))
v4l2_fmt_output = output->format.fmt.pix_mp.pixelformat;