diff mpegaudio.c @ 925:7fccaa0d699d libavcodec

AVVideoFrame -> AVFrame
author michaelni
date Mon, 09 Dec 2002 12:03:43 +0000
parents 714795876872
children 19de1445beb2
line wrap: on
line diff
--- a/mpegaudio.c	Mon Dec 09 00:29:17 2002 +0000
+++ b/mpegaudio.c	Mon Dec 09 12:03:43 2002 +0000
@@ -70,7 +70,6 @@
     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 @@
         total_quant_bits[i] = 12 * v;
     }
 
+    avctx->coded_frame= avcodec_alloc_frame();
+    avctx->coded_frame->key_frame= 1;
+
     return 0;
 }
 
@@ -765,6 +767,10 @@
     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 @@
     sizeof(MpegAudioContext),
     MPA_encode_init,
     MPA_encode_frame,
+    MPA_encode_close,
     NULL,
 };