]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blobdiff - libavutil/fifo.c
frsh: Export information about the last RTP contract and VRES
[frescor/ffmpeg.git] / libavutil / fifo.c
index 9a9a139f3b1185e7b2687712d530a82214592864..840b73a57bf7f1d0476c0b076aeccb2cf0f72e45 100644 (file)
@@ -54,6 +54,11 @@ int av_fifo_size(AVFifoBuffer *f)
     return (uint32_t)(f->wndx - f->rndx);
 }
 
+int av_fifo_space(AVFifoBuffer *f)
+{
+    return f->end - f->buffer - av_fifo_size(f);
+}
+
 int av_fifo_realloc2(AVFifoBuffer *f, unsigned int new_size) {
     unsigned int old_size= f->end - f->buffer;
 
@@ -63,7 +68,7 @@ int av_fifo_realloc2(AVFifoBuffer *f, unsigned int new_size) {
 
         if (!f2)
             return -1;
-        av_fifo_generic_read(f, len, NULL, f2->buffer);
+        av_fifo_generic_read(f, f2->buffer, len, NULL);
         f2->wptr += len;
         f2->wndx += len;
         av_free(f->buffer);
@@ -96,7 +101,7 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void
 }
 
 
-int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void*, int), void* dest)
+int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int))
 {
 // Read memory barrier needed for SMP here in theory
     do {