lavfi: Always propagate hw_frames_ctx through links
[ffmpeg.git] / libavfilter / vf_hwdownload.c
index 4ba465bcc74999c24135e1511bf24a363e6fb3d2..aee8d23cb78f9f221370145c55dd1dbb6e30e5cc 100644 (file)
@@ -140,7 +140,8 @@ static int hwdownload_filter_frame(AVFilterLink *link, AVFrame *input)
         goto fail;
     }
 
-    output = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+    output = ff_get_video_buffer(outlink, ctx->hwframes->width,
+                                 ctx->hwframes->height);
     if (!output) {
         err = AVERROR(ENOMEM);
         goto fail;
@@ -152,6 +153,9 @@ static int hwdownload_filter_frame(AVFilterLink *link, AVFrame *input)
         goto fail;
     }
 
+    output->width  = outlink->w;
+    output->height = outlink->h;
+
     err = av_frame_copy_props(output, input);
     if (err < 0)
         goto fail;
@@ -208,4 +212,5 @@ AVFilter ff_vf_hwdownload = {
     .priv_class    = &hwdownload_class,
     .inputs        = hwdownload_inputs,
     .outputs       = hwdownload_outputs,
+    .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
 };