* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "libavcodec/bitstream.h"
+#include "libavcodec/put_bits.h"
#include "avformat.h"
#include "swf.h"
put_bits(&p, nbits, ymax & mask);
flush_put_bits(&p);
- put_buffer(pb, buf, pbBufPtr(&p) - p.buf);
+ put_buffer(pb, buf, put_bits_ptr(&p) - p.buf);
}
static void put_swf_line_edge(PutBitContext *pb, int dx, int dy)
put_bits(&p, nbits, ty);
flush_put_bits(&p);
- put_buffer(pb, buf, pbBufPtr(&p) - p.buf);
+ put_buffer(pb, buf, put_bits_ptr(&p) - p.buf);
}
static int swf_write_header(AVFormatContext *s)
}
swf->audio_enc = enc;
swf->audio_fifo= av_fifo_alloc(AUDIO_FIFO_SIZE);
+ if (!swf->audio_fifo)
+ return AVERROR(ENOMEM);
} else {
av_log(s, AV_LOG_ERROR, "SWF muxer only supports MP3\n");
return -1;
put_bits(&p, 5, 0);
flush_put_bits(&p);
- put_buffer(pb, buf1, pbBufPtr(&p) - p.buf);
+ put_buffer(pb, buf1, put_bits_ptr(&p) - p.buf);
put_swf_end_tag(s);
}
put_le16(pb, enc->width);
put_le16(pb, enc->height);
put_byte(pb, 0);
- put_byte(pb,codec_get_tag(swf_codec_tags,enc->codec_id));
+ put_byte(pb,ff_codec_get_tag(swf_codec_tags,enc->codec_id));
put_swf_end_tag(s);
/* place the video object for the first time */
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 */