Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fcf59764 authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarKamil Debski <k.debski@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 4a31b52f
Loading
Loading
Loading
Loading
+6 −5
Original line number Original line Diff line number Diff line
@@ -426,12 +426,13 @@ static int coda_try_fmt_vid_out(struct file *file, void *priv,
				struct v4l2_format *f)
				struct v4l2_format *f)
{
{
	struct coda_ctx *ctx = fh_to_ctx(priv);
	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 */
	/* Determine codec by encoded format, returns NULL if raw or invalid */
	if (ctx->inst_type == CODA_INST_DECODER) {
		codec = coda_find_codec(ctx->dev, f->fmt.pix.pixelformat,
		codec = coda_find_codec(ctx->dev, f->fmt.pix.pixelformat,
					V4L2_PIX_FMT_YUV420);
					V4L2_PIX_FMT_YUV420);
	if (!codec && ctx->inst_type == CODA_INST_DECODER) {
		if (!codec)
			codec = coda_find_codec(ctx->dev, V4L2_PIX_FMT_H264,
			codec = coda_find_codec(ctx->dev, V4L2_PIX_FMT_H264,
						V4L2_PIX_FMT_YUV420);
						V4L2_PIX_FMT_YUV420);
		if (!codec)
		if (!codec)