summaryrefslogtreecommitdiff
path: root/libavformat/swfenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-03-08 14:16:55 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-03-08 14:16:55 +0000
commit41dd680dd80d93626e133c02b92e31cabb756eeb (patch)
treee21e3fdda1fab791bf322d167be5e02c414e4384 /libavformat/swfenc.c
parent48d58e592aa258494beed72954fff74b5827acca (diff)
Allocate AVFifoBuffer through the fifo API to reduce future API/ABI issues.
Yes this breaks ABI/API but ive already broken it and will bump avutil major soon. Originally committed as revision 17869 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/swfenc.c')
-rw-r--r--libavformat/swfenc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavformat/swfenc.c b/libavformat/swfenc.c
index b433f6b713..7ed8cc3553 100644
--- a/libavformat/swfenc.c
+++ b/libavformat/swfenc.c
@@ -192,7 +192,7 @@ static int swf_write_header(AVFormatContext *s)
return -1;
}
swf->audio_enc = enc;
- av_fifo_init(&swf->audio_fifo, AUDIO_FIFO_SIZE);
+ swf->audio_fifo= av_fifo_alloc(AUDIO_FIFO_SIZE);
} else {
av_log(s, AV_LOG_ERROR, "SWF muxer only supports MP3\n");
return -1;
@@ -414,12 +414,12 @@ static int swf_write_video(AVFormatContext *s,
swf->swf_frame_number++;
/* streaming sound always should be placed just before showframe tags */
- if (swf->audio_enc && av_fifo_size(&swf->audio_fifo)) {
- int frame_size = av_fifo_size(&swf->audio_fifo);
+ if (swf->audio_enc && av_fifo_size(swf->audio_fifo)) {
+ int frame_size = av_fifo_size(swf->audio_fifo);
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, frame_size, &put_buffer, pb);
put_swf_end_tag(s);
/* update FIFO */
@@ -444,12 +444,12 @@ static int swf_write_audio(AVFormatContext *s,
if (swf->swf_frame_number == 16000)
av_log(enc, AV_LOG_INFO, "warning: Flash Player limit of 16000 frames reached\n");
- if (av_fifo_size(&swf->audio_fifo) + size > AUDIO_FIFO_SIZE) {
+ if (av_fifo_size(swf->audio_fifo) + size > AUDIO_FIFO_SIZE) {
av_log(s, AV_LOG_ERROR, "audio fifo too small to mux audio essence\n");
return -1;
}
- av_fifo_generic_write(&swf->audio_fifo, buf, size, NULL);
+ av_fifo_generic_write(swf->audio_fifo, buf, size, NULL);
swf->sound_samples += enc->frame_size;
/* if audio only stream make sure we add swf frames */
@@ -481,7 +481,7 @@ static int swf_write_trailer(AVFormatContext *s)
if (enc->codec_type == CODEC_TYPE_VIDEO)
video_enc = enc;
else
- av_fifo_free(&swf->audio_fifo);
+ av_fifo_free(swf->audio_fifo);
}
put_swf_tag(s, TAG_END);