[FFmpeg-devel] [PATCH] use const for pointer instead of casting const away

Reimar Döffinger Reimar.Doeffinger
Sun Dec 2 20:24:38 CET 2007


Hello,
there is something weird in dca.c, I assume it is a stupid bug, but
I thought I better ask.
Instead of defining prCoeff to "const float *", fir_32bands_nonperfect
and fir_32bands_perfect are being cast to "float *".
Ok to apply attached patch?

Greetings,
Reimar D?ffinger
-------------- next part --------------
Index: libavcodec/dca.c
===================================================================
--- libavcodec/dca.c	(revision 11130)
+++ libavcodec/dca.c	(working copy)
@@ -646,7 +646,7 @@
                             float samples_in[32][8], float *samples_out,
                             float scale, float bias)
 {
-    float *prCoeff;
+    const float *prCoeff;
     int i, j, k;
     float praXin[33], *raXin = &praXin[1];
 
@@ -659,9 +659,9 @@
 
     /* Select filter */
     if (!s->multirate_inter)    /* Non-perfect reconstruction */
-        prCoeff = (float *) fir_32bands_nonperfect;
+        prCoeff = fir_32bands_nonperfect;
     else                        /* Perfect reconstruction */
-        prCoeff = (float *) fir_32bands_perfect;
+        prCoeff = fir_32bands_perfect;
 
     /* Reconstructed channel sample index */
     for (subindex = 0; subindex < 8; subindex++) {



More information about the ffmpeg-devel mailing list