[FFmpeg-cvslog] avfilter/vf_scale_npp: move aspect ratio correction after av_frame_copy_props

Miroslav Slugeň git at videolan.org
Wed Nov 30 13:42:38 EET 2016


ffmpeg | branch: master | Miroslav Slugeň <thunder.m at email.cz> | Sun Nov 27 01:09:05 2016 +0100| [1d056dd855e408a0c7debf1d0e9fe09b0a439cea] | committer: Timo Rothenpieler

avfilter/vf_scale_npp: move aspect ratio correction after av_frame_copy_props

Signed-off-by: Timo Rothenpieler <timo at rothenpieler.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1d056dd855e408a0c7debf1d0e9fe09b0a439cea
---

 libavfilter/vf_scale_npp.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavfilter/vf_scale_npp.c b/libavfilter/vf_scale_npp.c
index 78f541e..3c1d1e9 100644
--- a/libavfilter/vf_scale_npp.c
+++ b/libavfilter/vf_scale_npp.c
@@ -586,11 +586,6 @@ static int nppscale_filter_frame(AVFilterLink *link, AVFrame *in)
         goto fail;
     }
 
-    av_reduce(&out->sample_aspect_ratio.num, &out->sample_aspect_ratio.den,
-              (int64_t)in->sample_aspect_ratio.num * outlink->h * link->w,
-              (int64_t)in->sample_aspect_ratio.den * outlink->w * link->h,
-              INT_MAX);
-
     err = device_hwctx->internal->cuda_dl->cuCtxPushCurrent(device_hwctx->cuda_ctx);
     if (err != CUDA_SUCCESS) {
         ret = AVERROR_UNKNOWN;
@@ -603,6 +598,11 @@ static int nppscale_filter_frame(AVFilterLink *link, AVFrame *in)
     if (ret < 0)
         goto fail;
 
+    av_reduce(&out->sample_aspect_ratio.num, &out->sample_aspect_ratio.den,
+              (int64_t)in->sample_aspect_ratio.num * outlink->h * link->w,
+              (int64_t)in->sample_aspect_ratio.den * outlink->w * link->h,
+              INT_MAX);
+
     av_frame_free(&in);
     return ff_filter_frame(outlink, out);
 fail:



More information about the ffmpeg-cvslog mailing list