See previous commits for details.
Unified · Split
| @@ -249,18 +249,24 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) · 248 unmodified lines | |||
| 249 | AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_DBL, | 249 | AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_DBL, |
| 250 | }; | 250 | }; |
| 251 | 251 | ||
| 252 | ret = avfilter_graph_create_filter(&sink, abuffersink, | 252 | sink = avfilter_graph_alloc_filter(lavfi->graph, abuffersink, inout->name); |
| 253 | inout->name, NULL, | 253 | if (!sink) { |
| 254 | NULL, lavfi->graph); | 254 | ret = AVERROR(ENOMEM); |
| 255 | if (ret >= 0) | 255 | goto end; |
| 256 | ret = av_opt_set_bin(sink, "sample_fmts", (const uint8_t*)sample_fmts, | 256 | } |
| 257 | sizeof(sample_fmts), AV_OPT_SEARCH_CHILDREN); | 257 | |
| 258 | ret = av_opt_set_bin(sink, "sample_fmts", (const uint8_t*)sample_fmts, | ||
| 259 | sizeof(sample_fmts), AV_OPT_SEARCH_CHILDREN); | ||
| 258 | if (ret < 0) | 260 | if (ret < 0) |
| 259 | goto end; | 261 | goto end; |
| 260 | ret = av_opt_set_int(sink, "all_channel_counts", 1, | 262 | ret = av_opt_set_int(sink, "all_channel_counts", 1, |
| 261 | AV_OPT_SEARCH_CHILDREN); | 263 | AV_OPT_SEARCH_CHILDREN); |
| 262 | if (ret < 0) | 264 | if (ret < 0) |
| 263 | goto end; | 265 | goto end; |
| 266 | |||
| 267 | ret = avfilter_init_dict(sink, NULL); | ||
| 268 | if (ret < 0) | ||
| 269 | goto end; | ||
| 264 | } else { | 270 | } else { |
| 265 | av_log(avctx, AV_LOG_ERROR, | 271 | av_log(avctx, AV_LOG_ERROR, |
| 266 | "Output '%s' is not a video or audio output, not yet supported\n", inout->name); | 272 | "Output '%s' is not a video or audio output, not yet supported\n", inout->name); |