void add_codec(FFStream *stream, AVCodecContext *av)

{

    AVStream *st;



    /* compute default parameters */

    switch(av->codec_type) {

    case CODEC_TYPE_AUDIO:

        if (av->bit_rate == 0)

            av->bit_rate = 64000;

        if (av->sample_rate == 0)

            av->sample_rate = 22050;

        if (av->channels == 0)

            av->channels = 1;

        break;

    case CODEC_TYPE_VIDEO:

        if (av->bit_rate == 0)

            av->bit_rate = 64000;

        if (av->frame_rate == 0)

            av->frame_rate = 5 * FRAME_RATE_BASE;

        if (av->width == 0 || av->height == 0) {

            av->width = 160;

            av->height = 128;

        }

        /* Bitrate tolerance is less for streaming */

        if (av->bit_rate_tolerance == 0)

            av->bit_rate_tolerance = av->bit_rate / 4;

        if (av->qmin == 0)

            av->qmin = 3;

        if (av->qmax == 0)

            av->qmax = 31;

        if (av->max_qdiff == 0)

            av->max_qdiff = 3;

        av->qcompress = 0.5;

        av->qblur = 0.5;



        break;

    default:

        abort();

    }



    st = av_mallocz(sizeof(AVStream));

    if (!st)

        return;

    stream->streams[stream->nb_streams++] = st;

    memcpy(&st->codec, av, sizeof(AVCodecContext));

}

void add_codec(FFStream *stream, AVCodecContext *av)

{

    AVStream *st;



    

    switch(av->codec_type) {

    case CODEC_TYPE_AUDIO:

        if (av->bit_rate == 0)

            av->bit_rate = 64000;

        if (av->sample_rate == 0)

            av->sample_rate = 22050;

        if (av->channels == 0)

            av->channels = 1;

        break;

    case CODEC_TYPE_VIDEO:

        if (av->bit_rate == 0)

            av->bit_rate = 64000;

        if (av->frame_rate == 0)

            av->frame_rate = 5 * FRAME_RATE_BASE;

        if (av->width == 0 || av->height == 0) {

            av->width = 160;

            av->height = 128;

        }

        

        if (av->bit_rate_tolerance == 0)

            av->bit_rate_tolerance = av->bit_rate / 4;

        if (av->qmin == 0)

            av->qmin = 3;

        if (av->qmax == 0)

            av->qmax = 31;

        if (av->max_qdiff == 0)

            av->max_qdiff = 3;

        av->qcompress = 0.5;

        av->qblur = 0.5;



        break;

    default:

        abort();

    }



    st = av_mallocz(sizeof(AVStream));

    if (!st)

        return;

    stream->streams[stream->nb_streams++] = st;

    memcpy(&st->codec, av, sizeof(AVCodecContext));

}

        abort();         abort();
void FUNC_0(FFStream *VAR_0, AVCodecContext *VAR_1)

{

    AVStream *st;



    

    switch(VAR_1->codec_type) {

    case CODEC_TYPE_AUDIO:

        if (VAR_1->bit_rate == 0)

            VAR_1->bit_rate = 64000;

        if (VAR_1->sample_rate == 0)

            VAR_1->sample_rate = 22050;

        if (VAR_1->channels == 0)

            VAR_1->channels = 1;

        break;

    case CODEC_TYPE_VIDEO:

        if (VAR_1->bit_rate == 0)

            VAR_1->bit_rate = 64000;

        if (VAR_1->frame_rate == 0)

            VAR_1->frame_rate = 5 * FRAME_RATE_BASE;

        if (VAR_1->width == 0 || VAR_1->height == 0) {

            VAR_1->width = 160;

            VAR_1->height = 128;

        }

        

        if (VAR_1->bit_rate_tolerance == 0)

            VAR_1->bit_rate_tolerance = VAR_1->bit_rate / 4;

        if (VAR_1->qmin == 0)

            VAR_1->qmin = 3;

        if (VAR_1->qmax == 0)

            VAR_1->qmax = 31;

        if (VAR_1->max_qdiff == 0)

            VAR_1->max_qdiff = 3;

        VAR_1->qcompress = 0.5;

        VAR_1->qblur = 0.5;



        break;

    default:

        abort();

    }



    st = av_mallocz(sizeof(AVStream));

    if (!st)

        return;

    VAR_0->streams[VAR_0->nb_streams++] = st;

    memcpy(&st->codec, VAR_1, sizeof(AVCodecContext));

}

void FUNC_0(FFStream *VAR_0, AVCodecContext *VAR_1)
{ AVStream *st; switch(VAR_1->codec_type) { case CODEC_TYPE_AUDIO:
if (VAR_1->bit_rate == 0)
VAR_1->bit_rate = 64000; if (VAR_1->sample_rate == 0)
VAR_1->sample_rate = 22050; if (VAR_1->channels == 0)
VAR_1->channels = 1; break; case CODEC_TYPE_VIDEO:
if (VAR_1->bit_rate == 0)
VAR_1->bit_rate = 64000; if (VAR_1->frame_rate == 0)
VAR_1->frame_rate = 5 * FRAME_RATE_BASE; if (VAR_1->width == 0 || VAR_1->height == 0) { VAR_1->width = 160; VAR_1->height = 128; } if (VAR_1->bit_rate_tolerance == 0)
VAR_1->bit_rate_tolerance = VAR_1->bit_rate / 4; if (VAR_1->qmin == 0)
VAR_1->qmin = 3; if (VAR_1->qmax == 0)
VAR_1->qmax = 31; if (VAR_1->max_qdiff == 0)
VAR_1->max_qdiff = 3; VAR_1->qcompress = 0.5; VAR_1->qblur = 0.5; break; default:
abort(); } st = av_mallocz(sizeof(AVStream)); if (!st)
return; VAR_0->streams[VAR_0->nb_streams++] = st; memcpy(&st->codec, VAR_1, sizeof(AVCodecContext)); }