1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-18 23:35:06 +02:00

vf_deshake: Fix cast discards qualifiers from pointer target type warning.

And simplify the code in the process.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-10-19 00:03:13 +02:00
parent e96aa8d1a0
commit 5ed20cfeaf

View File

@ -94,10 +94,8 @@ typedef struct {
Transform avg;
} DeshakeContext;
static int cmp(void const *ca, void const *cb)
static int cmp(const double *a, const double *b)
{
double *a = (double *) ca;
double *b = (double *) cb;
return *a < *b ? -1 : ( *a > *b ? 1 : 0 );
}
@ -110,7 +108,7 @@ static double clean_mean(double *values, int count)
int cut = count / 5;
int x;
qsort(values, count, sizeof(double), cmp);
qsort(values, count, sizeof(double), (void*)cmp);
for (x = cut; x < count - cut; x++) {
mean += values[x];