diff options
author | Martin <marthi@graphics.cs.uni-sb.de> | 2006-11-20 20:35:47 +0000 |
---|---|---|
committer | Guillaume Poirier <gpoirier@mplayerhq.hu> | 2006-11-20 20:35:47 +0000 |
commit | 4ec0ccb1a4181d5c103809c90ece5fd87b70e091 (patch) | |
tree | 7997368d2425ee2b2a0fb6f91478b8236a2eeda4 | |
parent | 0d6d96329466b78b92adbb9444dba1e75317b347 (diff) | |
download | ffmpeg-4ec0ccb1a4181d5c103809c90ece5fd87b70e091.tar.gz |
allow amr bitrate to be changed "on the fly" through avctx->bitrate.
Patch by Martin % marthi A graphics P cs P uni - sb P de %
Original thread:
date: Nov 20, 2006 6:20 PM
subject: Re: [Ffmpeg-devel] [PATCH] Re: AMR bitrate
Originally committed as revision 7139 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/amr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/amr.c b/libavcodec/amr.c index d24c8fe7db..12c918bf5b 100644 --- a/libavcodec/amr.c +++ b/libavcodec/amr.c @@ -482,6 +482,8 @@ static int amr_nb_encode_frame(AVCodecContext *avctx, AMRContext *s = (AMRContext*)avctx->priv_data; int written; + s->enc_bitrate=getBitrateMode(avctx->bit_rate); + written = Encoder_Interface_Encode(s->enstate, s->enc_bitrate, data, @@ -624,7 +626,9 @@ static int amr_wb_encode_frame(AVCodecContext *avctx, unsigned char *frame/*out*/, int buf_size, void *data/*in*/) { AMRWBContext *s = (AMRWBContext*) avctx->priv_data; - int size = E_IF_encode(s->state, s->mode, data, frame, s->allow_dtx); + int size; + s->mode=getWBBitrateMode(avctx->bit_rate); + size = E_IF_encode(s->state, s->mode, data, frame, s->allow_dtx); return size; } |