[FFmpeg-cvslog] g723.1: declare a variable in the block it is used

Mans Rullgard git at videolan.org
Mon Aug 13 14:49:45 CEST 2012


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Sat Aug 11 20:19:39 2012 +0100| [cbcf1b411fac6aabf731e14e4f48bca3d956f868] | committer: Mans Rullgard

g723.1: declare a variable in the block it is used

Signed-off-by: Mans Rullgard <mans at mansr.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cbcf1b411fac6aabf731e14e4f48bca3d956f868
---

 libavcodec/g723_1.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c
index c0cea19..657c144 100644
--- a/libavcodec/g723_1.c
+++ b/libavcodec/g723_1.c
@@ -1006,7 +1006,6 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
     int16_t cur_lsp[LPC_ORDER];
     int16_t lpc[SUBFRAMES * LPC_ORDER];
     int16_t acb_vector[SUBFRAME_LEN];
-    int16_t *vector_ptr;
     int16_t *out;
     int bad_frame = 0, i, j, ret;
     int16_t *audio = p->audio;
@@ -1051,8 +1050,9 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
         /* Generate the excitation for the frame */
         memcpy(p->excitation, p->prev_excitation,
                PITCH_MAX * sizeof(*p->excitation));
-        vector_ptr = p->excitation + PITCH_MAX;
         if (!p->erased_frames) {
+            int16_t *vector_ptr = p->excitation + PITCH_MAX;
+
             /* Update interpolation gain memory */
             p->interp_gain = fixed_cb_gain[(p->subframe[2].amp_index +
                                             p->subframe[3].amp_index) >> 1];



More information about the ffmpeg-cvslog mailing list