static void choose_sample_rate(AVStream *st, AVCodec *codec)

{

    if(codec && codec->supported_samplerates){

        const int *p= codec->supported_samplerates;

        int best;

        int best_dist=INT_MAX;

        for(; *p; p++){

            int dist= abs(st->codec->sample_rate - *p);

            if(dist < best_dist){

                best_dist= dist;

                best= *p;

            }

        }

        if(best_dist){

            av_log(st->codec, AV_LOG_WARNING, "Requested sampling rate unsupported using closest supported (%d)\n", best);

        }

        st->codec->sample_rate= best;

    }

}

static void choose_sample_rate(AVStream *st, AVCodec *codec)

{

    if(codec && codec->supported_samplerates){

        const int *p= codec->supported_samplerates;

        int best;

        int best_dist=INT_MAX;

        for(; *p; p++){

            int dist= abs(st->codec->sample_rate - *p);

            if(dist < best_dist){

                best_dist= dist;

                best= *p;

            }

        }

        if(best_dist){

            av_log(st->codec, AV_LOG_WARNING, "Requested sampling rate unsupported using closest supported (%d)\n", best);

        }

        st->codec->sample_rate= best;

    }

}

        int best;
static void FUNC_0(AVStream *VAR_0, AVCodec *VAR_1)

{

    if(VAR_1 && VAR_1->supported_samplerates){

        const int *VAR_2= VAR_1->supported_samplerates;

        int VAR_3;

        int VAR_4=INT_MAX;

        for(; *VAR_2; VAR_2++){

            int VAR_5= abs(VAR_0->VAR_1->sample_rate - *VAR_2);

            if(VAR_5 < VAR_4){

                VAR_4= VAR_5;

                VAR_3= *VAR_2;

            }

        }

        if(VAR_4){

            av_log(VAR_0->VAR_1, AV_LOG_WARNING, "Requested sampling rate unsupported using closest supported (%d)\n", VAR_3);

        }

        VAR_0->VAR_1->sample_rate= VAR_3;

    }

}

static void FUNC_0(AVStream *VAR_0, AVCodec *VAR_1)
{ if(VAR_1 && VAR_1->supported_samplerates){ const int *VAR_2= VAR_1->supported_samplerates; int VAR_3; int VAR_4=INT_MAX; for(; *VAR_2; VAR_2++){ int VAR_5= abs(VAR_0->VAR_1->sample_rate - *VAR_2); if(VAR_5 < VAR_4){ VAR_4= VAR_5; VAR_3= *VAR_2; } } if(VAR_4){ av_log(VAR_0->VAR_1, AV_LOG_WARNING, "Requested sampling rate unsupported using closest supported (%d)\n", VAR_3); } VAR_0->VAR_1->sample_rate= VAR_3; } }