diff mbox series

[FFmpeg-devel] scale_vt implementation for negative width/height sizing

Message ID 20240915202950.60640-1-koushd@gmail.com
State New
Headers show
Series [FFmpeg-devel] scale_vt implementation for negative width/height sizing | expand

Checks

Context Check Description
yinshiyou/commit_msg_loongarch64 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/commit_msg_x86 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Koushik Dutta Sept. 15, 2024, 8:29 p.m. UTC
---
 libavfilter/vf_scale_vt.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/vf_scale_vt.c b/libavfilter/vf_scale_vt.c
index 3da46a6cd5..3785b884d9 100644
--- a/libavfilter/vf_scale_vt.c
+++ b/libavfilter/vf_scale_vt.c
@@ -33,8 +33,6 @@  typedef struct ScaleVtContext {
     AVClass *class;
 
     VTPixelTransferSessionRef transfer;
-    int output_width;
-    int output_height;
     char *w_expr;
     char *h_expr;
 
@@ -232,15 +230,18 @@  static int scale_vt_config_output(AVFilterLink *outlink)
     FilterLink        *inl = ff_filter_link(inlink);
     AVHWFramesContext *hw_frame_ctx_in;
     AVHWFramesContext *hw_frame_ctx_out;
+    int w, h;
 
     err = ff_scale_eval_dimensions(s, s->w_expr, s->h_expr, inlink, outlink,
-                                   &s->output_width,
-                                   &s->output_height);
+                                   &w,
+                                   &h);
     if (err < 0)
         return err;
 
-    outlink->w = s->output_width;
-    outlink->h = s->output_height;
+    ff_scale_adjust_dimensions(inlink, &w, &h, 0, 1);
+
+    outlink->w = w;
+    outlink->h = h;
 
     if (inlink->sample_aspect_ratio.num) {
         AVRational r = {outlink->h * inlink->w, outlink->w * inlink->h};