Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193096
b: refs/heads/master
c: b2dfd1a
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed May 19, 2010
1 parent 98317a5 commit cef0499
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bc0f7f19ab9ba5c7ec648b400d1360b525fa1a3a
refs/heads/master: b2dfd1a45f014e24f0eecc50a7edc954425c348a
16 changes: 8 additions & 8 deletions trunk/drivers/media/video/videobuf-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,10 @@ static void videobuf_status(struct videobuf_queue *q, struct v4l2_buffer *b,
case VIDEOBUF_ACTIVE:
b->flags |= V4L2_BUF_FLAG_QUEUED;
break;
case VIDEOBUF_DONE:
case VIDEOBUF_ERROR:
b->flags |= V4L2_BUF_FLAG_ERROR;
/* fall through */
case VIDEOBUF_DONE:
b->flags |= V4L2_BUF_FLAG_DONE;
break;
case VIDEOBUF_NEEDS_INIT:
Expand Down Expand Up @@ -670,6 +672,7 @@ int videobuf_dqbuf(struct videobuf_queue *q,

MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS);

memset(b, 0, sizeof(*b));
mutex_lock(&q->vb_lock);

retval = stream_next_buffer(q, &buf, nonblocking);
Expand All @@ -681,23 +684,20 @@ int videobuf_dqbuf(struct videobuf_queue *q,
switch (buf->state) {
case VIDEOBUF_ERROR:
dprintk(1, "dqbuf: state is error\n");
retval = -EIO;
CALL(q, sync, q, buf);
buf->state = VIDEOBUF_IDLE;
break;
case VIDEOBUF_DONE:
dprintk(1, "dqbuf: state is done\n");
CALL(q, sync, q, buf);
buf->state = VIDEOBUF_IDLE;
break;
default:
dprintk(1, "dqbuf: state invalid\n");
retval = -EINVAL;
goto done;
}
list_del(&buf->stream);
memset(b, 0, sizeof(*b));
CALL(q, sync, q, buf);
videobuf_status(q, b, buf, q->type);
list_del(&buf->stream);
buf->state = VIDEOBUF_IDLE;
b->flags &= ~V4L2_BUF_FLAG_DONE;
done:
mutex_unlock(&q->vb_lock);
return retval;
Expand Down

0 comments on commit cef0499

Please sign in to comment.