aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-fileops.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-07-28 11:07:12 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:05:32 -0400
commitf4071b85ea0ca3bd06f63c330562b4cfdffa8473 (patch)
tree8390a1bb512949e9520f65de160e1e7291a4c36f /drivers/media/video/ivtv/ivtv-fileops.c
parent3562c43be8cfd6e300508d7c33acebf3369eacd3 (diff)
V4L/DVB (6046): ivtv: always steal full frames if out of buffers.
When there are no more free buffers, then buffers are stolen from the predma queue. Buffers should be stolen from the head of that queue (which is where the most recently added buffers are) and all buffers belonging to a frame should be stolen. Otherwise 'half-frames' would remain in the queue, which leads to ugly playback and complete sync failure for YUV buffers. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-fileops.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-fileops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c
index 908e640c274d..076b0089a2b0 100644
--- a/drivers/media/video/ivtv/ivtv-fileops.c
+++ b/drivers/media/video/ivtv/ivtv-fileops.c
@@ -247,8 +247,9 @@ static struct ivtv_buffer *ivtv_get_buffer(struct ivtv_stream *s, int non_block,
247 /* do we have new data? */ 247 /* do we have new data? */
248 buf = ivtv_dequeue(s, &s->q_full); 248 buf = ivtv_dequeue(s, &s->q_full);
249 if (buf) { 249 if (buf) {
250 if (!test_and_clear_bit(IVTV_F_B_NEED_BUF_SWAP, &buf->b_flags)) 250 if ((buf->b_flags & IVTV_F_B_NEED_BUF_SWAP) == 0)
251 return buf; 251 return buf;
252 buf->b_flags &= ~IVTV_F_B_NEED_BUF_SWAP;
252 if (s->type == IVTV_ENC_STREAM_TYPE_MPG) 253 if (s->type == IVTV_ENC_STREAM_TYPE_MPG)
253 /* byteswap MPG data */ 254 /* byteswap MPG data */
254 ivtv_buf_swap(buf); 255 ivtv_buf_swap(buf);