summaryrefslogtreecommitdiff
path: root/libavcodec/mpegaudio.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-12-09 12:03:43 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-12-09 12:03:43 +0000
commit492cd3a9203779380cea24f23190b92af2b48007 (patch)
tree4a673a16c3e2c0ac4dc28a10ae2d5f6b6a32fda4 /libavcodec/mpegaudio.c
parentf694168d524d1c84f5f20f4260fcab1f4d8c11d7 (diff)
AVVideoFrame -> AVFrame
Originally committed as revision 1327 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegaudio.c')
-rw-r--r--libavcodec/mpegaudio.c9
1 files changed, 8 insertions, 1 deletions
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,
};