| @@ -60,7 +60,7 @@ static const AVOption aformat_options[] = { · 59 unmodified lines |
| 60 | | 60 | |
| 61 | AVFILTER_DEFINE_CLASS(aformat); | 61 | AVFILTER_DEFINE_CLASS(aformat); |
| 62 | | 62 | |
| 63 | #define PARSE_FORMATS(str, type, list, add_to_list, unref_fn, get_fmt, none, desc) \ | 63 | #define PARSE_FORMATS(str, type, list, add_to_list, get_fmt, none, desc) \ |
| 64 | do { \ | 64 | do { \ |
| 65 | char *next, *cur = str, sep; \ | 65 | char *next, *cur = str, sep; \ |
| 66 | int ret; \ | 66 | int ret; \ |
| @@ -83,7 +83,6 @@ do { \ · 16 unmodified lines |
| 83 | return AVERROR(EINVAL); \ | 83 | return AVERROR(EINVAL); \ |
| 84 | } \ | 84 | } \ |
| 85 | if ((ret = add_to_list(&list, fmt)) < 0) { \ | 85 | if ((ret = add_to_list(&list, fmt)) < 0) { \ |
| 86 | unref_fn(&list); \ | | |
| 87 | return ret; \ | 86 | return ret; \ |
| 88 | } \ | 87 | } \ |
| 89 | \ | 88 | \ |
| @@ -102,11 +101,11 @@ static av_cold int init(AVFilterContext *ctx) · 12 unmodified lines |
| 102 | AFormatContext *s = ctx->priv; | 101 | AFormatContext *s = ctx->priv; |
| 103 | | 102 | |
| 104 | PARSE_FORMATS(s->formats_str, enum AVSampleFormat, s->formats, | 103 | PARSE_FORMATS(s->formats_str, enum AVSampleFormat, s->formats, |
| 105 | ff_add_format, ff_formats_unref, av_get_sample_fmt, AV_SAMPLE_FMT_NONE, "sample format"); | 104 | ff_add_format, av_get_sample_fmt, AV_SAMPLE_FMT_NONE, "sample format"); |
| 106 | PARSE_FORMATS(s->sample_rates_str, int, s->sample_rates, ff_add_format, ff_formats_unref, | 105 | PARSE_FORMATS(s->sample_rates_str, int, s->sample_rates, ff_add_format, |
| 107 | get_sample_rate, 0, "sample rate"); | 106 | get_sample_rate, 0, "sample rate"); |
| 108 | PARSE_FORMATS(s->channel_layouts_str, uint64_t, s->channel_layouts, | 107 | PARSE_FORMATS(s->channel_layouts_str, uint64_t, s->channel_layouts, |
| 109 | ff_add_channel_layout, ff_channel_layouts_unref, av_get_channel_layout, 0, | 108 | ff_add_channel_layout, av_get_channel_layout, 0, |
| 110 | "channel layout"); | 109 | "channel layout"); |
| 111 | | 110 | |
| 112 | return 0; | 111 | return 0; |