mirror of https://git.ffmpeg.org/ffmpeg.git
lavd/lavfi: stop using avfilter_graph_create_filter() incorrectly
See previous commits for details.
This commit is contained in:
parent
577708a70a
commit
d3f76dbca1
|
@ -249,10 +249,12 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
|
||||||
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_DBL,
|
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_DBL,
|
||||||
};
|
};
|
||||||
|
|
||||||
ret = avfilter_graph_create_filter(&sink, abuffersink,
|
sink = avfilter_graph_alloc_filter(lavfi->graph, abuffersink, inout->name);
|
||||||
inout->name, NULL,
|
if (!sink) {
|
||||||
NULL, lavfi->graph);
|
ret = AVERROR(ENOMEM);
|
||||||
if (ret >= 0)
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
ret = av_opt_set_bin(sink, "sample_fmts", (const uint8_t*)sample_fmts,
|
ret = av_opt_set_bin(sink, "sample_fmts", (const uint8_t*)sample_fmts,
|
||||||
sizeof(sample_fmts), AV_OPT_SEARCH_CHILDREN);
|
sizeof(sample_fmts), AV_OPT_SEARCH_CHILDREN);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
@ -261,6 +263,10 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
|
||||||
AV_OPT_SEARCH_CHILDREN);
|
AV_OPT_SEARCH_CHILDREN);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
ret = avfilter_init_dict(sink, NULL);
|
||||||
|
if (ret < 0)
|
||||||
|
goto end;
|
||||||
} else {
|
} else {
|
||||||
av_log(avctx, AV_LOG_ERROR,
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
"Output '%s' is not a video or audio output, not yet supported\n", inout->name);
|
"Output '%s' is not a video or audio output, not yet supported\n", inout->name);
|
||||||
|
|
Loading…
Reference in New Issue