summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2015-12-02 14:58:53 -0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-12-23 14:03:35 -0200
commit49b966fa451c74bcb18fff415db0ae9b102fa33f (patch)
tree1741c798f50589f36107b6f5141f0e1fe8fcebf0
parentbb757d7bd3019a0af1513efaf020495b82a43056 (diff)
[media] coda: don't start streaming without queued buffers
We could support start streaming with an empty output queue for the BIT decoders due to the bitstream buffer which could still contain data at this point, but there is really no reason for userspace to expect this to work. Simplify the code by disallowing it. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/platform/coda/coda-common.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index 22f6ceab8f47..6f66a92362ee 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -1252,6 +1252,9 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count)
struct vb2_v4l2_buffer *buf;
int ret = 0;
+ if (count < 1)
+ return -EINVAL;
+
q_data_src = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
if (ctx->inst_type == CODA_INST_DECODER && ctx->use_bit) {
@@ -1264,20 +1267,10 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count)
ret = -EINVAL;
goto err;
}
- } else {
- if (count < 1) {
- ret = -EINVAL;
- goto err;
- }
}
ctx->streamon_out = 1;
} else {
- if (count < 1) {
- ret = -EINVAL;
- goto err;
- }
-
ctx->streamon_cap = 1;
}