[FFmpeg-cvslog] r17914 - in trunk: doc/APIchanges ffmpeg.c libavformat/audiointerleave.c libavformat/mpegenc.c libavformat/swfenc.c libavutil/fifo.c libavutil/fifo.h

reimar subversion
Mon Mar 9 18:47:48 CET 2009


Author: reimar
Date: Mon Mar  9 18:47:47 2009
New Revision: 17914

Log:
Reorder arguments for av_fifo_generic_read to be more logical and
consistent with av_fifo_generic_write.

Modified:
   trunk/doc/APIchanges
   trunk/ffmpeg.c
   trunk/libavformat/audiointerleave.c
   trunk/libavformat/mpegenc.c
   trunk/libavformat/swfenc.c
   trunk/libavutil/fifo.c
   trunk/libavutil/fifo.h

Modified: trunk/doc/APIchanges
==============================================================================
--- trunk/doc/APIchanges	Mon Mar  9 18:44:57 2009	(r17913)
+++ trunk/doc/APIchanges	Mon Mar  9 18:47:47 2009	(r17914)
@@ -15,6 +15,8 @@ API changes, most recent first:
 20090308 - r17869 - lavu 50.0.0  - AVFifoBuffer
   av_fifo_init, av_fifo_read, av_fifo_write and av_fifo_realloc were dropped and replaced
   by av_fifo_alloc, av_fifo_generic_read, av_fifo_generic_write and av_fifo_realloc2.
+  In addition, the order of the function arguments of av_fifo_generic_read were changed
+  to match av_fifo_generic_write.
   The AVFifoBuffer/struct AVFifoBuffer may only be used in an opaque way by applications,
   they may not use sizeof() or directly access members.
 

Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c	Mon Mar  9 18:44:57 2009	(r17913)
+++ trunk/ffmpeg.c	Mon Mar  9 18:47:47 2009	(r17914)
@@ -672,7 +672,7 @@ static void do_audio_out(AVFormatContext
             AVPacket pkt;
             av_init_packet(&pkt);
 
-            av_fifo_generic_read(ost->fifo, frame_bytes, NULL, audio_buf);
+            av_fifo_generic_read(ost->fifo, audio_buf, frame_bytes, NULL);
 
             //FIXME pass ost->sync_opts as AVFrame.pts in avcodec_encode_audio()
 
@@ -1452,7 +1452,7 @@ static int output_packet(AVInputStream *
                             if(fifo_bytes > 0 && enc->codec->capabilities & CODEC_CAP_SMALL_LAST_FRAME) {
                                 int fs_tmp = enc->frame_size;
                                 enc->frame_size = fifo_bytes / (2 * enc->channels);
-                                av_fifo_generic_read(ost->fifo, fifo_bytes, NULL, samples);
+                                av_fifo_generic_read(ost->fifo, samples, fifo_bytes, NULL);
                                     ret = avcodec_encode_audio(enc, bit_buffer, bit_buffer_size, samples);
                                 enc->frame_size = fs_tmp;
                             }

Modified: trunk/libavformat/audiointerleave.c
==============================================================================
--- trunk/libavformat/audiointerleave.c	Mon Mar  9 18:44:57 2009	(r17913)
+++ trunk/libavformat/audiointerleave.c	Mon Mar  9 18:47:47 2009	(r17914)
@@ -80,7 +80,7 @@ static int ff_interleave_new_audio_packe
         return 0;
 
     av_new_packet(pkt, size);
-    av_fifo_generic_read(aic->fifo, size, NULL, pkt->data);
+    av_fifo_generic_read(aic->fifo, pkt->data, size, NULL);
 
     pkt->dts = pkt->pts = aic->dts;
     pkt->duration = av_rescale_q(*aic->samples, st->time_base, aic->time_base);

Modified: trunk/libavformat/mpegenc.c
==============================================================================
--- trunk/libavformat/mpegenc.c	Mon Mar  9 18:44:57 2009	(r17913)
+++ trunk/libavformat/mpegenc.c	Mon Mar  9 18:47:47 2009	(r17914)
@@ -914,7 +914,7 @@ static int flush_packet(AVFormatContext 
 
         /* output data */
         assert(payload_size - stuffing_size <= av_fifo_size(stream->fifo));
-        av_fifo_generic_read(stream->fifo, payload_size - stuffing_size, &put_buffer, ctx->pb);
+        av_fifo_generic_read(stream->fifo, ctx->pb, payload_size - stuffing_size, &put_buffer);
         stream->bytes_to_iframe -= payload_size - stuffing_size;
     }else{
         payload_size=

Modified: trunk/libavformat/swfenc.c
==============================================================================
--- trunk/libavformat/swfenc.c	Mon Mar  9 18:44:57 2009	(r17913)
+++ trunk/libavformat/swfenc.c	Mon Mar  9 18:47:47 2009	(r17914)
@@ -419,7 +419,7 @@ static int swf_write_video(AVFormatConte
         put_swf_tag(s, TAG_STREAMBLOCK | TAG_LONG);
         put_le16(pb, swf->sound_samples);
         put_le16(pb, 0); // seek samples
-        av_fifo_generic_read(swf->audio_fifo, frame_size, &put_buffer, pb);
+        av_fifo_generic_read(swf->audio_fifo, pb, frame_size, &put_buffer);
         put_swf_end_tag(s);
 
         /* update FIFO */

Modified: trunk/libavutil/fifo.c
==============================================================================
--- trunk/libavutil/fifo.c	Mon Mar  9 18:44:57 2009	(r17913)
+++ trunk/libavutil/fifo.c	Mon Mar  9 18:47:47 2009	(r17914)
@@ -63,7 +63,7 @@ int av_fifo_realloc2(AVFifoBuffer *f, un
 
         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 +96,7 @@ int av_fifo_generic_write(AVFifoBuffer *
 }
 
 
-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 {

Modified: trunk/libavutil/fifo.h
==============================================================================
--- trunk/libavutil/fifo.h	Mon Mar  9 18:44:57 2009	(r17913)
+++ trunk/libavutil/fifo.h	Mon Mar  9 18:47:47 2009	(r17914)
@@ -68,7 +68,7 @@ int av_fifo_size(AVFifoBuffer *f);
  * @param *func generic read function
  * @param *dest data destination
  */
-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));
 
 /**
  * Feeds data from a user-supplied callback to an AVFifoBuffer.




More information about the ffmpeg-cvslog mailing list