Better readability and allows reuse
Unified · Split
| @@ -398,15 +398,19 @@ static int scale_frame(AVFilterLink *link, AVFrame *in, AVFrame **frame_out) · 397 unmodified lines | ||
| 398 | 398 | const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format); |
| 399 | 399 | char buf[32]; |
| 400 | 400 | int in_range; |
| 401 | + int frame_changed; | |
| 401 | 402 | |
| 402 | 403 | *frame_out = NULL; |
| 403 | 404 | if (in->colorspace == AVCOL_SPC_YCGCO) |
| 404 | 405 | av_log(link->dst, AV_LOG_WARNING, "Detected unsupported YCgCo colorspace.\n"); |
| 405 | 406 | |
| 406 | − if ( in->width != link->w | |
| 407 | − || in->height != link->h | |
| 408 | − || in->format != link->format | |
| 409 | − || in->sample_aspect_ratio.den != link->sample_aspect_ratio.den || in->sample_aspect_ratio.num != link->sample_aspect_ratio.num) { | |
| 407 | + frame_changed = in->width != link->w || | |
| 408 | + in->height != link->h || | |
| 409 | + in->format != link->format || | |
| 410 | + in->sample_aspect_ratio.den != link->sample_aspect_ratio.den || | |
| 411 | + in->sample_aspect_ratio.num != link->sample_aspect_ratio.num; | |
| 412 | + | |
| 413 | + if (frame_changed) { | |
| 410 | 414 | int ret; |
| 411 | 415 | |
| 412 | 416 | if (scale->eval_mode == EVAL_MODE_INIT) { |