lavfi: Always propagate hw_frames_ctx through links
[ffmpeg.git] / libavfilter / vf_hwupload_cuda.c
index dfb35066f604aca12f4ecb417509120dd4470105..94d5013cc6ac0ef94c9a60e193292874c603755d 100644 (file)
@@ -156,16 +156,12 @@ static int cudaupload_filter_frame(AVFilterLink *link, AVFrame *in)
     AVFrame *out = NULL;
     int ret;
 
-    out = av_frame_alloc();
+    out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
     if (!out) {
         ret = AVERROR(ENOMEM);
         goto fail;
     }
 
-    ret = av_hwframe_get_buffer(s->hwframe, out, 0);
-    if (ret < 0)
-        goto fail;
-
     out->width  = in->width;
     out->height = in->height;
 
@@ -234,4 +230,6 @@ AVFilter ff_vf_hwupload_cuda = {
 
     .inputs    = cudaupload_inputs,
     .outputs   = cudaupload_outputs,
+
+    .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
 };