changeset 4632:260b5f667458 libavcodec

Move the initialization on context definition. In amr.c, only the amr_wb_encode_frame function initialized its context on a different line as it defined it. Patch by Benoit Fouet, benoit fouet % purplelabs com.
author takis
date Thu, 08 Mar 2007 10:06:59 +0000
parents cd3e32d16136
children cd67b7ab311c
files amr.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/amr.c	Wed Mar 07 09:51:45 2007 +0000
+++ b/amr.c	Thu Mar 08 10:06:59 2007 +0000
@@ -607,9 +607,9 @@
 static int amr_wb_encode_frame(AVCodecContext *avctx,
                             unsigned char *frame/*out*/, int buf_size, void *data/*in*/)
 {
-    AMRWBContext *s;
+    AMRWBContext *s = (AMRWBContext*) avctx->priv_data;
     int size;
-    s = (AMRWBContext*) avctx->priv_data;
+
     s->mode=getWBBitrateMode(avctx->bit_rate);
     size = E_IF_encode(s->state, s->mode, data, frame, s->allow_dtx);
     return size;