| 441 | } |
| 442 | |
| 443 | static int bsf_list_append_internal(AVBSFList *lst, const char *bsf_name, const char *options, AVDictionary ** options_dict) |
| 444 | { |
| 445 | int ret; |
| 446 | const AVBitStreamFilter *filter; |
| 447 | AVBSFContext *bsf; |
| 448 | |
| 449 | filter = av_bsf_get_by_name(bsf_name); |
| 450 | if (!filter) |
| 451 | return AVERROR_BSF_NOT_FOUND; |
| 452 | |
| 453 | ret = av_bsf_alloc(filter, &bsf); |
| 454 | if (ret < 0) |
| 455 | return ret; |
| 456 | |
| 457 | if (options && filter->priv_class) { |
| 458 | const AVOption *opt = av_opt_next(bsf->priv_data, NULL); |
| 459 | const char * shorthand[2] = {NULL}; |
| 460 | |
| 461 | if (opt) |
| 462 | shorthand[0] = opt->name; |
| 463 | |
| 464 | ret = av_opt_set_from_string(bsf->priv_data, options, shorthand, "=", ":"); |
| 465 | if (ret < 0) |
| 466 | goto end; |
| 467 | } |
| 468 | |
| 469 | if (options_dict) { |
| 470 | ret = av_opt_set_dict2(bsf, options_dict, AV_OPT_SEARCH_CHILDREN); |
| 471 | if (ret < 0) |
| 472 | goto end; |
| 473 | } |
| 474 | |
| 475 | ret = av_bsf_list_append(lst, bsf); |
| 476 | |
| 477 | end: |
| 478 | if (ret < 0) |
| 479 | av_bsf_free(&bsf); |
| 480 | |
| 481 | return ret; |
| 482 | } |
| 483 | |
| 484 | int av_bsf_list_append2(AVBSFList *lst, const char *bsf_name, AVDictionary ** options) |
| 485 | { |
no test coverage detected