]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/truespeech.c
avcodec: Constify AVCodecs
[ffmpeg] / libavcodec / truespeech.c
index d7c2d535e21870e0f61255aee440eee28ffdca9f..5eac34fefcd104d8cdac98ed0664daee518430e8 100644 (file)
@@ -21,6 +21,8 @@
 
 #include "libavutil/channel_layout.h"
 #include "libavutil/intreadwrite.h"
+#include "libavutil/mem_internal.h"
+
 #include "avcodec.h"
 #include "bswapdsp.h"
 #include "get_bits.h"
@@ -255,7 +257,7 @@ static void truespeech_synth(TSContext *dec, int16_t *out, int quart)
         int sum = 0;
         for(k = 0; k < 8; k++)
             sum += ptr0[k] * (unsigned)ptr1[k];
-        sum = out[i] + ((sum + 0x800) >> 12);
+        sum = out[i] + ((int)(sum + 0x800U) >> 12);
         out[i] = av_clip(sum, -0x7FFE, 0x7FFE);
         for(k = 7; k > 0; k--)
             ptr0[k] = ptr0[k - 1];
@@ -353,7 +355,7 @@ static int truespeech_decode_frame(AVCodecContext *avctx, void *data,
     return buf_size;
 }
 
-AVCodec ff_truespeech_decoder = {
+const AVCodec ff_truespeech_decoder = {
     .name           = "truespeech",
     .long_name      = NULL_IF_CONFIG_SMALL("DSP Group TrueSpeech"),
     .type           = AVMEDIA_TYPE_AUDIO,