comparison oggvorbis.c @ 925:7fccaa0d699d libavcodec

AVVideoFrame -> AVFrame
author michaelni
date Mon, 09 Dec 2002 12:03:43 +0000
parents b0d29bf1cecd
children 159333d9297e
comparison
equal deleted inserted replaced
924:3814e9115672 925:7fccaa0d699d
22 vorbis_comment vc ; 22 vorbis_comment vc ;
23 } OggVorbisContext ; 23 } OggVorbisContext ;
24 24
25 25
26 int oggvorbis_init_encoder(vorbis_info *vi, AVCodecContext *avccontext) { 26 int oggvorbis_init_encoder(vorbis_info *vi, AVCodecContext *avccontext) {
27 if(avccontext->quality) /* VBR requested */ 27 if(avccontext->coded_frame->quality) /* VBR requested */
28 return vorbis_encode_init_vbr(vi, avccontext->channels, 28 return vorbis_encode_init_vbr(vi, avccontext->channels,
29 avccontext->sample_rate, (float)avccontext->quality / 1000) ; 29 avccontext->sample_rate, (float)avccontext->coded_frame->quality / 1000) ;
30 30
31 return vorbis_encode_init(vi, avccontext->channels, 31 return vorbis_encode_init(vi, avccontext->channels,
32 avccontext->sample_rate, -1, avccontext->bit_rate, -1) ; 32 avccontext->sample_rate, -1, avccontext->bit_rate, -1) ;
33 } 33 }
34 34
43 } 43 }
44 vorbis_analysis_init(&context->vd, &context->vi) ; 44 vorbis_analysis_init(&context->vd, &context->vi) ;
45 vorbis_block_init(&context->vd, &context->vb) ; 45 vorbis_block_init(&context->vd, &context->vb) ;
46 46
47 avccontext->frame_size = OGGVORBIS_FRAME_SIZE ; 47 avccontext->frame_size = OGGVORBIS_FRAME_SIZE ;
48
49 avccontext->coded_frame= avcodec_alloc_frame();
50 avccontext->coded_frame->key_frame= 1;
48 51
49 return 0 ; 52 return 0 ;
50 } 53 }
51 54
52 55
111 */ 114 */
112 115
113 vorbis_block_clear(&context->vb); 116 vorbis_block_clear(&context->vb);
114 vorbis_dsp_clear(&context->vd); 117 vorbis_dsp_clear(&context->vd);
115 vorbis_info_clear(&context->vi); 118 vorbis_info_clear(&context->vi);
119
120 av_freep(&avccontext->coded_frame);
116 121
117 return 0 ; 122 return 0 ;
118 } 123 }
119 124
120 125