static int asink_query_formats(AVFilterContext *ctx)

{

    BufferSinkContext *buf = ctx->priv;

    AVFilterFormats *formats = NULL;

    AVFilterChannelLayouts *layouts = NULL;

    unsigned i;

    int ret;



    CHECK_LIST_SIZE(sample_fmts)

    CHECK_LIST_SIZE(sample_rates)

    CHECK_LIST_SIZE(channel_layouts)

    CHECK_LIST_SIZE(channel_counts)



    if (buf->sample_fmts_size) {

        for (i = 0; i < NB_ITEMS(buf->sample_fmts); i++)

            if ((ret = ff_add_format(&formats, buf->sample_fmts[i])) < 0)

                return ret;

        ff_set_common_formats(ctx, formats);

    }



    if (buf->channel_layouts_size || buf->channel_counts_size ||

        buf->all_channel_counts) {

        for (i = 0; i < NB_ITEMS(buf->channel_layouts); i++)

            if ((ret = ff_add_channel_layout(&layouts, buf->channel_layouts[i])) < 0)

                return ret;

        for (i = 0; i < NB_ITEMS(buf->channel_counts); i++)

            if ((ret = ff_add_channel_layout(&layouts, FF_COUNT2LAYOUT(buf->channel_counts[i]))) < 0)

                return ret;

        if (buf->all_channel_counts) {

            if (layouts)

                av_log(ctx, AV_LOG_WARNING,

                       "Conflicting all_channel_counts and list in options\n");

            else if (!(layouts = ff_all_channel_counts()))

                return AVERROR(ENOMEM);

        }

        ff_set_common_channel_layouts(ctx, layouts);

    }



    if (buf->sample_rates_size) {

        formats = NULL;

        for (i = 0; i < NB_ITEMS(buf->sample_rates); i++)

            if ((ret = ff_add_format(&formats, buf->sample_rates[i])) < 0)

                return ret;

        ff_set_common_samplerates(ctx, formats);

    }



    return 0;

}

static int asink_query_formats(AVFilterContext *ctx)

{

    BufferSinkContext *buf = ctx->priv;

    AVFilterFormats *formats = NULL;

    AVFilterChannelLayouts *layouts = NULL;

    unsigned i;

    int ret;



    CHECK_LIST_SIZE(sample_fmts)

    CHECK_LIST_SIZE(sample_rates)

    CHECK_LIST_SIZE(channel_layouts)

    CHECK_LIST_SIZE(channel_counts)



    if (buf->sample_fmts_size) {

        for (i = 0; i < NB_ITEMS(buf->sample_fmts); i++)

            if ((ret = ff_add_format(&formats, buf->sample_fmts[i])) < 0)

                return ret;

        ff_set_common_formats(ctx, formats);

    }



    if (buf->channel_layouts_size || buf->channel_counts_size ||

        buf->all_channel_counts) {

        for (i = 0; i < NB_ITEMS(buf->channel_layouts); i++)

            if ((ret = ff_add_channel_layout(&layouts, buf->channel_layouts[i])) < 0)

                return ret;

        for (i = 0; i < NB_ITEMS(buf->channel_counts); i++)

            if ((ret = ff_add_channel_layout(&layouts, FF_COUNT2LAYOUT(buf->channel_counts[i]))) < 0)

                return ret;

        if (buf->all_channel_counts) {

            if (layouts)

                av_log(ctx, AV_LOG_WARNING,

                       "Conflicting all_channel_counts and list in options\n");

            else if (!(layouts = ff_all_channel_counts()))

                return AVERROR(ENOMEM);

        }

        ff_set_common_channel_layouts(ctx, layouts);

    }



    if (buf->sample_rates_size) {

        formats = NULL;

        for (i = 0; i < NB_ITEMS(buf->sample_rates); i++)

            if ((ret = ff_add_format(&formats, buf->sample_rates[i])) < 0)

                return ret;

        ff_set_common_samplerates(ctx, formats);

    }



    return 0;

}

            if ((ret = ff_add_format(&formats, buf->sample_fmts[i])) < 0)             if ((ret = ff_add_channel_layout(&layouts, buf->channel_layouts[i])) < 0)             if ((ret = ff_add_channel_layout(&layouts, FF_COUNT2LAYOUT(buf->channel_counts[i]))) < 0)             if ((ret = ff_add_format(&formats, buf->sample_rates[i])) < 0)
static int FUNC_0(AVFilterContext *VAR_0)

{

    BufferSinkContext *buf = VAR_0->priv;

    AVFilterFormats *formats = NULL;

    AVFilterChannelLayouts *layouts = NULL;

    unsigned VAR_1;

    int VAR_2;



    CHECK_LIST_SIZE(sample_fmts)

    CHECK_LIST_SIZE(sample_rates)

    CHECK_LIST_SIZE(channel_layouts)

    CHECK_LIST_SIZE(channel_counts)



    if (buf->sample_fmts_size) {

        for (VAR_1 = 0; VAR_1 < NB_ITEMS(buf->sample_fmts); VAR_1++)

            if ((VAR_2 = ff_add_format(&formats, buf->sample_fmts[VAR_1])) < 0)

                return VAR_2;

        ff_set_common_formats(VAR_0, formats);

    }



    if (buf->channel_layouts_size || buf->channel_counts_size ||

        buf->all_channel_counts) {

        for (VAR_1 = 0; VAR_1 < NB_ITEMS(buf->channel_layouts); VAR_1++)

            if ((VAR_2 = ff_add_channel_layout(&layouts, buf->channel_layouts[VAR_1])) < 0)

                return VAR_2;

        for (VAR_1 = 0; VAR_1 < NB_ITEMS(buf->channel_counts); VAR_1++)

            if ((VAR_2 = ff_add_channel_layout(&layouts, FF_COUNT2LAYOUT(buf->channel_counts[VAR_1]))) < 0)

                return VAR_2;

        if (buf->all_channel_counts) {

            if (layouts)

                av_log(VAR_0, AV_LOG_WARNING,

                       "Conflicting all_channel_counts and list in options\n");

            else if (!(layouts = ff_all_channel_counts()))

                return AVERROR(ENOMEM);

        }

        ff_set_common_channel_layouts(VAR_0, layouts);

    }



    if (buf->sample_rates_size) {

        formats = NULL;

        for (VAR_1 = 0; VAR_1 < NB_ITEMS(buf->sample_rates); VAR_1++)

            if ((VAR_2 = ff_add_format(&formats, buf->sample_rates[VAR_1])) < 0)

                return VAR_2;

        ff_set_common_samplerates(VAR_0, formats);

    }



    return 0;

}

static int FUNC_0(AVFilterContext *VAR_0)
{ BufferSinkContext *buf = VAR_0->priv; AVFilterFormats *formats = NULL; AVFilterChannelLayouts *layouts = NULL; unsigned VAR_1; int VAR_2; CHECK_LIST_SIZE(sample_fmts)
CHECK_LIST_SIZE(sample_rates)
CHECK_LIST_SIZE(channel_layouts)
CHECK_LIST_SIZE(channel_counts)
if (buf->sample_fmts_size) { for (VAR_1 = 0; VAR_1 < NB_ITEMS(buf->sample_fmts); VAR_1++) if ((VAR_2 = ff_add_format(&formats, buf->sample_fmts[VAR_1])) < 0)
return VAR_2; ff_set_common_formats(VAR_0, formats); } if (buf->channel_layouts_size || buf->channel_counts_size ||
buf->all_channel_counts) { for (VAR_1 = 0; VAR_1 < NB_ITEMS(buf->channel_layouts); VAR_1++) if ((VAR_2 = ff_add_channel_layout(&layouts, buf->channel_layouts[VAR_1])) < 0)
return VAR_2; for (VAR_1 = 0; VAR_1 < NB_ITEMS(buf->channel_counts); VAR_1++) if ((VAR_2 = ff_add_channel_layout(&layouts, FF_COUNT2LAYOUT(buf->channel_counts[VAR_1]))) < 0)
return VAR_2; if (buf->all_channel_counts) { if (layouts)
av_log(VAR_0, AV_LOG_WARNING,
"Conflicting all_channel_counts and list in options\n"); else if (!(layouts = ff_all_channel_counts()))
return AVERROR(ENOMEM); } ff_set_common_channel_layouts(VAR_0, layouts); } if (buf->sample_rates_size) { formats = NULL; for (VAR_1 = 0; VAR_1 < NB_ITEMS(buf->sample_rates); VAR_1++) if ((VAR_2 = ff_add_format(&formats, buf->sample_rates[VAR_1])) < 0)
return VAR_2; ff_set_common_samplerates(VAR_0, formats); } return 0; }