Mercurial > libavcodec.hg
comparison mp3lameaudio.c @ 1871:9457292b0b65 libavcodec
disable lames leading zero "feature", fixes a few more flv encoding issues
author | michael |
---|---|
date | Wed, 10 Mar 2004 00:43:24 +0000 |
parents | 317ba7ab73bd |
children | 486236d25f89 |
comparison
equal
deleted
inserted
replaced
1870:d493ce1c4497 | 1871:9457292b0b65 |
---|---|
49 /* lame 3.91 dies on quality != 5 */ | 49 /* lame 3.91 dies on quality != 5 */ |
50 lame_set_quality(s->gfp, 5); | 50 lame_set_quality(s->gfp, 5); |
51 /* lame 3.91 doesn't work in mono */ | 51 /* lame 3.91 doesn't work in mono */ |
52 lame_set_mode(s->gfp, JOINT_STEREO); | 52 lame_set_mode(s->gfp, JOINT_STEREO); |
53 lame_set_brate(s->gfp, avctx->bit_rate/1000); | 53 lame_set_brate(s->gfp, avctx->bit_rate/1000); |
54 lame_set_bWriteVbrTag(s->gfp,0); | |
54 if (lame_init_params(s->gfp) < 0) | 55 if (lame_init_params(s->gfp) < 0) |
55 goto err_close; | 56 goto err_close; |
56 | 57 |
57 avctx->frame_size = MPA_FRAME_SIZE; | 58 avctx->frame_size = MPA_FRAME_SIZE; |
58 | 59 |
69 | 70 |
70 int MP3lame_encode_frame(AVCodecContext *avctx, | 71 int MP3lame_encode_frame(AVCodecContext *avctx, |
71 unsigned char *frame, int buf_size, void *data) | 72 unsigned char *frame, int buf_size, void *data) |
72 { | 73 { |
73 Mp3AudioContext *s = avctx->priv_data; | 74 Mp3AudioContext *s = avctx->priv_data; |
74 int num; | 75 int num, i; |
76 //av_log(avctx, AV_LOG_DEBUG, "%X %d %X\n", (int)frame, buf_size, (int)data); | |
77 // if(data==NULL) | |
78 // return lame_encode_flush(s->gfp, frame, buf_size); | |
75 | 79 |
76 /* lame 3.91 dies on '1-channel interleaved' data */ | 80 /* lame 3.91 dies on '1-channel interleaved' data */ |
77 if (s->stereo) { | 81 if (s->stereo) { |
78 num = lame_encode_buffer_interleaved(s->gfp, data, | 82 num = lame_encode_buffer_interleaved(s->gfp, data, |
79 MPA_FRAME_SIZE, frame, buf_size); | 83 MPA_FRAME_SIZE, frame, buf_size); |
80 } else { | 84 } else { |
81 num = lame_encode_buffer(s->gfp, data, data, MPA_FRAME_SIZE, | 85 num = lame_encode_buffer(s->gfp, data, data, MPA_FRAME_SIZE, |
82 frame, buf_size); | 86 frame, buf_size); |
87 | |
88 /*av_log(avctx, AV_LOG_DEBUG, "in:%d out:%d\n", MPA_FRAME_SIZE, num); | |
89 for(i=0; i<num; i++){ | |
90 av_log(avctx, AV_LOG_DEBUG, "%2X ", frame[i]); | |
91 }*/ | |
83 } | 92 } |
84 | 93 |
85 return num; | 94 return num; |
86 } | 95 } |
87 | 96 |