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