]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/truespeech.c
Do not warn about wrong channel layout if no channel layout is defined.
[ffmpeg] / libavcodec / truespeech.c
index c48a9c17694daa7ac2457f1dc967096daf5c5dff..8cd05145dbf98e6d8a5813878b2ed9a3a7d829a5 100644 (file)
@@ -2,20 +2,20 @@
  * DSP Group TrueSpeech compatible decoder
  * Copyright (c) 2005 Konstantin Shishkov
  *
- * This file is part of Libav.
+ * This file is part of FFmpeg.
  *
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -127,7 +127,7 @@ static void truespeech_correlate_filter(TSContext *dec)
 
     for(i = 0; i < 8; i++){
         if(i > 0){
-            memcpy(tmp, dec->cvector, i * 2);
+            memcpy(tmp, dec->cvector, i * sizeof(*tmp));
             for(j = 0; j < i; j++)
                 dec->cvector[j] = ((tmp[i - j - 1] * dec->vector[i]) +
                                    (dec->cvector[j] << 15) + 0x4000) >> 15;
@@ -169,7 +169,7 @@ static void truespeech_apply_twopoint_filter(TSContext *dec, int quart)
 
     t = dec->offset2[quart];
     if(t == 127){
-        memset(dec->newvec, 0, 60 * 2);
+        memset(dec->newvec, 0, 60 * sizeof(*dec->newvec));
         return;
     }
     for(i = 0; i < 146; i++)
@@ -194,7 +194,7 @@ static void truespeech_place_pulses(TSContext *dec, int16_t *out, int quart)
     int16_t *ptr2;
     int coef;
 
-    memset(out, 0, 60 * 2);
+    memset(out, 0, 60 * sizeof(*out));
     for(i = 0; i < 7; i++) {
         t = dec->pulseval[quart] & 3;
         dec->pulseval[quart] >>= 2;
@@ -310,7 +310,6 @@ static int truespeech_decode_frame(AVCodecContext *avctx,
 
     int i, j;
     short *samples = data;
-    int consumed = 0;
     int iterations, out_size;
 
     iterations = buf_size / 32;
@@ -330,8 +329,8 @@ static int truespeech_decode_frame(AVCodecContext *avctx,
     memset(samples, 0, out_size);
 
     for(j = 0; j < iterations; j++) {
-        truespeech_read_frame(c, buf + consumed);
-        consumed += 32;
+        truespeech_read_frame(c, buf);
+        buf += 32;
 
         truespeech_correlate_filter(c);
         truespeech_filters_merge(c);
@@ -349,7 +348,7 @@ static int truespeech_decode_frame(AVCodecContext *avctx,
 
     *data_size = out_size;
 
-    return consumed;
+    return buf_size;
 }
 
 AVCodec ff_truespeech_decoder = {