Mercurial > libavutil.hg
comparison fifo.c @ 691:4e9e0c52ed08 libavutil
Reorder arguments for av_fifo_generic_read to be more logical and
consistent with av_fifo_generic_write.
author | reimar |
---|---|
date | Mon, 09 Mar 2009 17:47:47 +0000 |
parents | 91216685a7ae |
children | 2f890bb12bbc |
comparison
equal
deleted
inserted
replaced
690:a2eb62aebb99 | 691:4e9e0c52ed08 |
---|---|
61 int len= av_fifo_size(f); | 61 int len= av_fifo_size(f); |
62 AVFifoBuffer *f2= av_fifo_alloc(new_size); | 62 AVFifoBuffer *f2= av_fifo_alloc(new_size); |
63 | 63 |
64 if (!f2) | 64 if (!f2) |
65 return -1; | 65 return -1; |
66 av_fifo_generic_read(f, len, NULL, f2->buffer); | 66 av_fifo_generic_read(f, f2->buffer, len, NULL); |
67 f2->wptr += len; | 67 f2->wptr += len; |
68 f2->wndx += len; | 68 f2->wndx += len; |
69 av_free(f->buffer); | 69 av_free(f->buffer); |
70 *f= *f2; | 70 *f= *f2; |
71 av_free(f2); | 71 av_free(f2); |
94 } while (size > 0); | 94 } while (size > 0); |
95 return total - size; | 95 return total - size; |
96 } | 96 } |
97 | 97 |
98 | 98 |
99 int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void*, int), void* dest) | 99 int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int)) |
100 { | 100 { |
101 // Read memory barrier needed for SMP here in theory | 101 // Read memory barrier needed for SMP here in theory |
102 do { | 102 do { |
103 int len = FFMIN(f->end - f->rptr, buf_size); | 103 int len = FFMIN(f->end - f->rptr, buf_size); |
104 if(func) func(dest, f->rptr, len); | 104 if(func) func(dest, f->rptr, len); |