Commit 1a179481 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] pwc: do not decompress the image unless the state is DONE

There is no point in trying to decompress a captured frame unless
the buffer state is OK. It won't be used in any other state, and
in fact the contents of the buffer might well be corrupt.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 06470642
...@@ -619,12 +619,15 @@ static void buffer_finish(struct vb2_buffer *vb) ...@@ -619,12 +619,15 @@ static void buffer_finish(struct vb2_buffer *vb)
struct pwc_device *pdev = vb2_get_drv_priv(vb->vb2_queue); struct pwc_device *pdev = vb2_get_drv_priv(vb->vb2_queue);
struct pwc_frame_buf *buf = container_of(vb, struct pwc_frame_buf, vb); struct pwc_frame_buf *buf = container_of(vb, struct pwc_frame_buf, vb);
/* if (vb->state == VB2_BUF_STATE_DONE) {
* Application has called dqbuf and is getting back a buffer we've /*
* filled, take the pwc data we've stored in buf->data and decompress * Application has called dqbuf and is getting back a buffer
* it into a usable format, storing the result in the vb2_buffer * we've filled, take the pwc data we've stored in buf->data
*/ * and decompress it into a usable format, storing the result
pwc_decompress(pdev, buf); * in the vb2_buffer.
*/
pwc_decompress(pdev, buf);
}
} }
static void buffer_cleanup(struct vb2_buffer *vb) static void buffer_cleanup(struct vb2_buffer *vb)
......
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