]> git.sesse.net Git - ffmpeg/blobdiff - libavdevice/lavfi.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavdevice / lavfi.c
index 159832a120cfe6a48561c3443a35c5e0cb8e6693..c1c9cf55b88c4a9345baa94fed109fc79724e328 100644 (file)
@@ -227,14 +227,11 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
         }
 
         if (type == AVMEDIA_TYPE_VIDEO) {
-            AVBufferSinkParams *buffersink_params = av_buffersink_params_alloc();
-
-            buffersink_params->pixel_fmts = pix_fmts;
             ret = avfilter_graph_create_filter(&sink, buffersink,
                                                inout->name, NULL,
-                                               buffersink_params, lavfi->graph);
-            av_freep(&buffersink_params);
-
+                                               NULL, lavfi->graph);
+            if (ret >= 0)
+                ret = av_opt_set_int_list(sink, "pix_fmts", pix_fmts,  AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN);
             if (ret < 0)
                 goto end;
         } else if (type == AVMEDIA_TYPE_AUDIO) {
@@ -243,13 +240,12 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
                                                   AV_SAMPLE_FMT_S32,
                                                   AV_SAMPLE_FMT_FLT,
                                                   AV_SAMPLE_FMT_DBL, -1 };
-            AVABufferSinkParams *abuffersink_params = av_abuffersink_params_alloc();
-            abuffersink_params->sample_fmts = sample_fmts;
 
             ret = avfilter_graph_create_filter(&sink, abuffersink,
                                                inout->name, NULL,
-                                               abuffersink_params, lavfi->graph);
-            av_free(abuffersink_params);
+                                               NULL, lavfi->graph);
+            if (ret >= 0)
+                ret = av_opt_set_int_list(sink, "sample_fmts", sample_fmts,  AV_SAMPLE_FMT_NONE, AV_OPT_SEARCH_CHILDREN);
             if (ret < 0)
                 goto end;
         }