History

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

Originally committed as revision 17914 to svn://svn.ffmpeg.org/ffmpeg/trunk

Reimar Döffinger committed 17 years ago

Commit 3898eed1 parent 60f75ad7 files · +10 −8Browse files

Unified · Split

7 files
  1. doc/APIchanges +2 −0
  2. ffmpeg.c +2 −2
  3. libavformat/audiointerleave.c +1 −1
  4. libavformat/mpegenc.c +1 −1
  5. libavformat/swfenc.c +1 −1
  6. libavutil/fifo.c +2 −2
  7. libavutil/fifo.h +1 −1
doc/APIchanges+2−0
@@ -15,6 +15,8 @@ API changes, most recent first: · 14 unmodified lines
1515 20090308 - r17869 - lavu 50.0.0 - AVFifoBuffer
1616 av_fifo_init, av_fifo_read, av_fifo_write and av_fifo_realloc were dropped and replaced
1717 by av_fifo_alloc, av_fifo_generic_read, av_fifo_generic_write and av_fifo_realloc2.
18+ In addition, the order of the function arguments of av_fifo_generic_read were changed
19+ to match av_fifo_generic_write.
1820 The AVFifoBuffer/struct AVFifoBuffer may only be used in an opaque way by applications,
1921 they may not use sizeof() or directly access members.
2022
ffmpeg.c+2−2
@@ -672,7 +672,7 @@ static void do_audio_out(AVFormatContext *s, · 671 unmodified lines
672672 AVPacket pkt;
673673 av_init_packet(&pkt);
674674
675− av_fifo_generic_read(ost->fifo, frame_bytes, NULL, audio_buf);
675+ av_fifo_generic_read(ost->fifo, audio_buf, frame_bytes, NULL);
676676
677677 //FIXME pass ost->sync_opts as AVFrame.pts in avcodec_encode_audio()
678678
@@ -1452,7 +1452,7 @@ static int output_packet(AVInputStream *ist, int ist_index, · 773 unmodified lines
14521452 if(fifo_bytes > 0 && enc->codec->capabilities & CODEC_CAP_SMALL_LAST_FRAME) {
14531453 int fs_tmp = enc->frame_size;
14541454 enc->frame_size = fifo_bytes / (2 * enc->channels);
1455− av_fifo_generic_read(ost->fifo, fifo_bytes, NULL, samples);
1455+ av_fifo_generic_read(ost->fifo, samples, fifo_bytes, NULL);
14561456 ret = avcodec_encode_audio(enc, bit_buffer, bit_buffer_size, samples);
14571457 enc->frame_size = fs_tmp;
14581458 }
libavformat/audiointerleave.c+1−1
@@ -80,7 +80,7 @@ static int ff_interleave_new_audio_packet(AVFormatContext *s, AVPacket *pkt, · 79 unmodified lines
8080 return 0;
8181
8282 av_new_packet(pkt, size);
83− av_fifo_generic_read(aic->fifo, size, NULL, pkt->data);
83+ av_fifo_generic_read(aic->fifo, pkt->data, size, NULL);
8484
8585 pkt->dts = pkt->pts = aic->dts;
8686 pkt->duration = av_rescale_q(*aic->samples, st->time_base, aic->time_base);
libavformat/mpegenc.c+1−1
@@ -914,7 +914,7 @@ static int flush_packet(AVFormatContext *ctx, int stream_index, · 913 unmodified lines
914914
915915 /* output data */
916916 assert(payload_size - stuffing_size <= av_fifo_size(stream->fifo));
917− av_fifo_generic_read(stream->fifo, payload_size - stuffing_size, &put_buffer, ctx->pb);
917+ av_fifo_generic_read(stream->fifo, ctx->pb, payload_size - stuffing_size, &put_buffer);
918918 stream->bytes_to_iframe -= payload_size - stuffing_size;
919919 }else{
920920 payload_size=
libavformat/swfenc.c+1−1
@@ -419,7 +419,7 @@ static int swf_write_video(AVFormatContext *s, · 418 unmodified lines
419419 put_swf_tag(s, TAG_STREAMBLOCK | TAG_LONG);
420420 put_le16(pb, swf->sound_samples);
421421 put_le16(pb, 0); // seek samples
422− av_fifo_generic_read(swf->audio_fifo, frame_size, &put_buffer, pb);
422+ av_fifo_generic_read(swf->audio_fifo, pb, frame_size, &put_buffer);
423423 put_swf_end_tag(s);
424424
425425 /* update FIFO */
libavutil/fifo.c+2−2
@@ -63,7 +63,7 @@ int av_fifo_realloc2(AVFifoBuffer *f, unsigned int new_size) { · 62 unmodified lines
6363
6464 if (!f2)
6565 return -1;
66− av_fifo_generic_read(f, len, NULL, f2->buffer);
66+ av_fifo_generic_read(f, f2->buffer, len, NULL);
6767 f2->wptr += len;
6868 f2->wndx += len;
6969 av_free(f->buffer);
@@ -96,7 +96,7 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void · 26 unmodified lines
9696 }
9797
9898
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))
100100 {
101101 // Read memory barrier needed for SMP here in theory
102102 do {
libavutil/fifo.h+1−1
@@ -68,7 +68,7 @@ int av_fifo_size(AVFifoBuffer *f); · 67 unmodified lines
6868 * @param *func generic read function
6969 * @param *dest data destination
7070 */
71−int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void*, int), void* dest);
71+int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int));
7272
7373 /**
7474 * Feeds data from a user-supplied callback to an AVFifoBuffer.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t