X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavdevice%2Flavfi.c;h=c1c9cf55b88c4a9345baa94fed109fc79724e328;hb=8f116bf71b2349bc3a8de08ef25c2b74f972db26;hp=15ac055dcd7bc09f6c2ce9a3ee3aec5097ddf7fc;hpb=ebbd4fd5f06ac7a5c762fe3c8ee9684bf7fcf960;p=ffmpeg diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c index 15ac055dcd7..c1c9cf55b88 100644 --- a/libavdevice/lavfi.c +++ b/libavdevice/lavfi.c @@ -230,8 +230,8 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) ret = avfilter_graph_create_filter(&sink, buffersink, inout->name, NULL, NULL, lavfi->graph); - av_opt_set_int_list(sink, "pix_fmts", pix_fmts, AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN); - + 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) { @@ -244,8 +244,8 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) ret = avfilter_graph_create_filter(&sink, abuffersink, inout->name, NULL, NULL, lavfi->graph); - - av_opt_set_int_list(sink, "sample_fmts", sample_fmts, AV_SAMPLE_FMT_NONE, AV_OPT_SEARCH_CHILDREN); + 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; }