[FFmpeg-cvslog] avfilter/scale: store frame change eval
Gyan Doshi
git at videolan.org
Wed Jan 15 08:36:24 EET 2020
ffmpeg | branch: master | Gyan Doshi <ffmpeg at gyani.pro> | Sun Dec 8 16:01:42 2019 +0530| [c21462d42e92cb62195e65d87ca732b4d6866eee] | committer: Gyan Doshi
avfilter/scale: store frame change eval
Better readability and allows reuse
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c21462d42e92cb62195e65d87ca732b4d6866eee
---
libavfilter/vf_scale.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 81b22075c3..6bda76bc99 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -398,15 +398,19 @@ static int scale_frame(AVFilterLink *link, AVFrame *in, AVFrame **frame_out)
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);
char buf[32];
int in_range;
+ int frame_changed;
*frame_out = NULL;
if (in->colorspace == AVCOL_SPC_YCGCO)
av_log(link->dst, AV_LOG_WARNING, "Detected unsupported YCgCo colorspace.\n");
- if ( in->width != link->w
- || in->height != link->h
- || in->format != link->format
- || in->sample_aspect_ratio.den != link->sample_aspect_ratio.den || in->sample_aspect_ratio.num != link->sample_aspect_ratio.num) {
+ frame_changed = in->width != link->w ||
+ in->height != link->h ||
+ in->format != link->format ||
+ in->sample_aspect_ratio.den != link->sample_aspect_ratio.den ||
+ in->sample_aspect_ratio.num != link->sample_aspect_ratio.num;
+
+ if (frame_changed) {
int ret;
if (scale->eval_mode == EVAL_MODE_INIT) {
More information about the ffmpeg-cvslog
mailing list