comparison mp3lameaudio.c @ 926:9a78dac52f4a libavcodec

100l
author michaelni
date Mon, 09 Dec 2002 14:33:20 +0000
parents f5e68f32069f
children 1e39f273ecd6
comparison
equal deleted inserted replaced
925:7fccaa0d699d 926:9a78dac52f4a
48 lame_set_brate(s->gfp, avctx->bit_rate/1000); 48 lame_set_brate(s->gfp, avctx->bit_rate/1000);
49 if (lame_init_params(s->gfp) < 0) 49 if (lame_init_params(s->gfp) < 0)
50 goto err_close; 50 goto err_close;
51 51
52 avctx->frame_size = MPA_FRAME_SIZE; 52 avctx->frame_size = MPA_FRAME_SIZE;
53 avctx->key_frame = 1; 53
54 avctx->coded_frame= avcodec_alloc_frame();
55 avctx->coded_frame->key_frame= 1;
54 56
55 return 0; 57 return 0;
56 58
57 err_close: 59 err_close:
58 lame_close(s->gfp); 60 lame_close(s->gfp);
79 } 81 }
80 82
81 int MP3lame_encode_close(AVCodecContext *avctx) 83 int MP3lame_encode_close(AVCodecContext *avctx)
82 { 84 {
83 Mp3AudioContext *s = avctx->priv_data; 85 Mp3AudioContext *s = avctx->priv_data;
86
87 av_freep(&avctx->coded_frame);
84 88
85 lame_close(s->gfp); 89 lame_close(s->gfp);
86 return 0; 90 return 0;
87 } 91 }
88 92