# HG changeset patch # User gpoirier # Date 1164054947 0 # Node ID 4115a044e31d8f9efb6253048cdf27ff5680df8c # Parent 58dba449406c97c363d4be3ac5f12a01a61bc774 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 diff -r 58dba449406c -r 4115a044e31d amr.c --- a/amr.c Mon Nov 20 14:13:32 2006 +0000 +++ b/amr.c Mon Nov 20 20:35:47 2006 +0000 @@ -482,6 +482,8 @@ 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 @@ 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; }