Commit cb06b705 authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab

[media] coda: simplify check in coda_buf_queue

Now that the bitstream buffer is only allocated for the BIT decoder
case, we can use bitstream.size to check for bitstream ringbuffer
operation.
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 <mchehab@osg.samsung.com>
parent e55317e7
...@@ -1154,6 +1154,7 @@ static int coda_buf_prepare(struct vb2_buffer *vb) ...@@ -1154,6 +1154,7 @@ static int coda_buf_prepare(struct vb2_buffer *vb)
static void coda_buf_queue(struct vb2_buffer *vb) static void coda_buf_queue(struct vb2_buffer *vb)
{ {
struct coda_ctx *ctx = vb2_get_drv_priv(vb->vb2_queue); struct coda_ctx *ctx = vb2_get_drv_priv(vb->vb2_queue);
struct vb2_queue *vq = vb->vb2_queue;
struct coda_q_data *q_data; struct coda_q_data *q_data;
q_data = get_q_data(ctx, vb->vb2_queue->type); q_data = get_q_data(ctx, vb->vb2_queue->type);
...@@ -1162,8 +1163,7 @@ static void coda_buf_queue(struct vb2_buffer *vb) ...@@ -1162,8 +1163,7 @@ static void coda_buf_queue(struct vb2_buffer *vb)
* In the decoder case, immediately try to copy the buffer into the * In the decoder case, immediately try to copy the buffer into the
* bitstream ringbuffer and mark it as ready to be dequeued. * bitstream ringbuffer and mark it as ready to be dequeued.
*/ */
if (ctx->use_bit && ctx->inst_type == CODA_INST_DECODER && if (ctx->bitstream.size && vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
vb->vb2_queue->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
/* /*
* For backwards compatibility, queuing an empty buffer marks * For backwards compatibility, queuing an empty buffer marks
* the stream end * the stream end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment