]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_scale_vaapi.c
Merge commit '5691c746cf62e69806aae1baf0a6e8252d519444'
[ffmpeg] / libavfilter / vf_scale_vaapi.c
index d349ff0f900cdf5fc499a67e0f9e33704e5f1124..d6529d5235a6644b6d8389309c2df5c0e2643d24 100644 (file)
@@ -31,7 +31,7 @@
 #include "vaapi_vpp.h"
 
 typedef struct ScaleVAAPIContext {
-    VAAPIVPPContext vpp_ctx; // must be the first fileld
+    VAAPIVPPContext vpp_ctx; // must be the first field
 
     char *output_format_string;
 
@@ -100,13 +100,13 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
 
     memset(&params, 0, sizeof(params));
 
-    // If there were top/left cropping, it could be taken into
-    // account here.
     input_region = (VARectangle) {
-        .x      = 0,
-        .y      = 0,
-        .width  = input_frame->width,
-        .height = input_frame->height,
+        .x      = input_frame->crop_left,
+        .y      = input_frame->crop_top,
+        .width  = input_frame->width -
+                 (input_frame->crop_left + input_frame->crop_right),
+        .height = input_frame->height -
+                 (input_frame->crop_top + input_frame->crop_bottom),
     };
 
     params.surface = input_surface;