From 492cd3a9203779380cea24f23190b92af2b48007 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 9 Dec 2002 12:03:43 +0000 Subject: AVVideoFrame -> AVFrame Originally committed as revision 1327 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/mpegaudio.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libavcodec/mpegaudio.c') diff --git a/libavcodec/mpegaudio.c b/libavcodec/mpegaudio.c index c6ebde1ec6..7d2dd8df19 100644 --- a/libavcodec/mpegaudio.c +++ b/libavcodec/mpegaudio.c @@ -70,7 +70,6 @@ int MPA_encode_init(AVCodecContext *avctx) s->freq = freq; s->bit_rate = bitrate * 1000; avctx->frame_size = MPA_FRAME_SIZE; - avctx->key_frame = 1; /* always key frame */ /* encoding freq */ s->lsf = 0; @@ -169,6 +168,9 @@ int MPA_encode_init(AVCodecContext *avctx) total_quant_bits[i] = 12 * v; } + avctx->coded_frame= avcodec_alloc_frame(); + avctx->coded_frame->key_frame= 1; + return 0; } @@ -765,6 +767,10 @@ int MPA_encode_frame(AVCodecContext *avctx, return pbBufPtr(&s->pb) - s->pb.buf; } +static int MPA_encode_close(AVCodecContext *avctx) +{ + av_freep(&avctx->coded_frame); +} AVCodec mp2_encoder = { "mp2", @@ -773,6 +779,7 @@ AVCodec mp2_encoder = { sizeof(MpegAudioContext), MPA_encode_init, MPA_encode_frame, + MPA_encode_close, NULL, }; -- cgit v1.2.3