changeset 4220:4115a044e31d libavcodec

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
author gpoirier
date Mon, 20 Nov 2006 20:35:47 +0000
parents 58dba449406c
children 643c7fd287e4
files amr.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }