Commit 5c11f5b4 authored by Clément Bœsch's avatar Clément Bœsch

avfilter/palettegen: move longest variable to a local scope

Also drop initialization since it is initialized later on before any
usage.
parent bbbc8c61
...@@ -285,7 +285,6 @@ static AVFrame *get_palette_frame(AVFilterContext *ctx) ...@@ -285,7 +285,6 @@ static AVFrame *get_palette_frame(AVFilterContext *ctx)
PaletteGenContext *s = ctx->priv; PaletteGenContext *s = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0]; AVFilterLink *outlink = ctx->outputs[0];
int box_id = 0; int box_id = 0;
int longest = 0;
struct range_box *box; struct range_box *box;
/* reference only the used colors from histogram */ /* reference only the used colors from histogram */
...@@ -310,7 +309,7 @@ static AVFrame *get_palette_frame(AVFilterContext *ctx) ...@@ -310,7 +309,7 @@ static AVFrame *get_palette_frame(AVFilterContext *ctx)
s->nb_boxes = 1; s->nb_boxes = 1;
while (box && box->len > 1) { while (box && box->len > 1) {
int i, rr, gr, br; int i, rr, gr, br, longest;
uint64_t median, box_weight = 0; uint64_t median, box_weight = 0;
/* compute the box weight (sum all the weights of the colors in the /* compute the box weight (sum all the weights of the colors in the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment