diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2014-08-05 14:00:12 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-08-21 15:25:24 -0500 |
commit | fcf59764b99c7daa9b0876fe65d1393e6b759673 (patch) | |
tree | 4bde9eff09a9cc4905f59985df0c6e5c2a1bf139 /drivers/media/platform/coda | |
parent | 4a31b52fca20d1fc0abe0d0f5489b9eec2760219 (diff) | |
download | blackbird-op-linux-fcf59764b99c7daa9b0876fe65d1393e6b759673.tar.gz blackbird-op-linux-fcf59764b99c7daa9b0876fe65d1393e6b759673.zip |
[media] coda: skip calling coda_find_codec in encoder try_fmt_vid_out
We know that it will return NULL in this case, so we can just as well
skip it altogether.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/platform/coda')
-rw-r--r-- | drivers/media/platform/coda/coda-common.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index 6760e346f969..4e85e387f905 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c @@ -426,15 +426,16 @@ static int coda_try_fmt_vid_out(struct file *file, void *priv, struct v4l2_format *f) { struct coda_ctx *ctx = fh_to_ctx(priv); - const struct coda_codec *codec; + const struct coda_codec *codec = NULL; /* Determine codec by encoded format, returns NULL if raw or invalid */ - codec = coda_find_codec(ctx->dev, f->fmt.pix.pixelformat, - V4L2_PIX_FMT_YUV420); - if (!codec && ctx->inst_type == CODA_INST_DECODER) { - codec = coda_find_codec(ctx->dev, V4L2_PIX_FMT_H264, + if (ctx->inst_type == CODA_INST_DECODER) { + codec = coda_find_codec(ctx->dev, f->fmt.pix.pixelformat, V4L2_PIX_FMT_YUV420); if (!codec) + codec = coda_find_codec(ctx->dev, V4L2_PIX_FMT_H264, + V4L2_PIX_FMT_YUV420); + if (!codec) return -EINVAL; } |