int check_codec_match(AVCodecContext *ccf, AVCodecContext *ccs, int stream)

{

    int matches = 1;



#define CHECK_CODEC(x)  (ccf->x != ccs->x)

    if (CHECK_CODEC(codec_id) || CHECK_CODEC(codec_type)) {

        http_log("Codecs do not match for stream %d\n", stream);

        matches = 0;

    } else if (CHECK_CODEC(bit_rate) || CHECK_CODEC(flags)) {

        http_log("Codec bitrates do not match for stream %d\n", stream);

        matches = 0;

    } else if (ccf->codec_type == AVMEDIA_TYPE_VIDEO) {

        if (CHECK_CODEC(time_base.den) ||

            CHECK_CODEC(time_base.num) ||

            CHECK_CODEC(width) ||

            CHECK_CODEC(height)) {

            http_log("Codec width, height or framerate do not match for stream %d\n", stream);

            matches = 0;

        }

    } else if (ccf->codec_type == AVMEDIA_TYPE_AUDIO) {

        if (CHECK_CODEC(sample_rate) ||

            CHECK_CODEC(channels) ||

            CHECK_CODEC(frame_size)) {

            http_log("Codec sample_rate, channels, frame_size do not match for stream %d\n", stream);

            matches = 0;

        }

    } else {

        http_log("Unknown codec type for stream %d\n", stream);

        matches = 0;

    }



    return matches;

}

int check_codec_match(AVCodecContext *ccf, AVCodecContext *ccs, int stream)

{

    int matches = 1;



#define CHECK_CODEC(x)  (ccf->x != ccs->x)

    if (CHECK_CODEC(codec_id) || CHECK_CODEC(codec_type)) {

        http_log("Codecs do not match for stream %d\n", stream);

        matches = 0;

    } else if (CHECK_CODEC(bit_rate) || CHECK_CODEC(flags)) {

        http_log("Codec bitrates do not match for stream %d\n", stream);

        matches = 0;

    } else if (ccf->codec_type == AVMEDIA_TYPE_VIDEO) {

        if (CHECK_CODEC(time_base.den) ||

            CHECK_CODEC(time_base.num) ||

            CHECK_CODEC(width) ||

            CHECK_CODEC(height)) {

            http_log("Codec width, height or framerate do not match for stream %d\n", stream);

            matches = 0;

        }

    } else if (ccf->codec_type == AVMEDIA_TYPE_AUDIO) {

        if (CHECK_CODEC(sample_rate) ||

            CHECK_CODEC(channels) ||

            CHECK_CODEC(frame_size)) {

            http_log("Codec sample_rate, channels, frame_size do not match for stream %d\n", stream);

            matches = 0;

        }

    } else {

        http_log("Unknown codec type for stream %d\n", stream);

        matches = 0;

    }



    return matches;

}

int FUNC_0(AVCodecContext *VAR_0, AVCodecContext *VAR_1, int VAR_2)

{

    int VAR_3 = 1;



#define CHECK_CODEC(x)  (VAR_0->x != VAR_1->x)

    if (CHECK_CODEC(codec_id) || CHECK_CODEC(codec_type)) {

        http_log("Codecs do not match for VAR_2 %d\n", VAR_2);

        VAR_3 = 0;

    } else if (CHECK_CODEC(bit_rate) || CHECK_CODEC(flags)) {

        http_log("Codec bitrates do not match for VAR_2 %d\n", VAR_2);

        VAR_3 = 0;

    } else if (VAR_0->codec_type == AVMEDIA_TYPE_VIDEO) {

        if (CHECK_CODEC(time_base.den) ||

            CHECK_CODEC(time_base.num) ||

            CHECK_CODEC(width) ||

            CHECK_CODEC(height)) {

            http_log("Codec width, height or framerate do not match for VAR_2 %d\n", VAR_2);

            VAR_3 = 0;

        }

    } else if (VAR_0->codec_type == AVMEDIA_TYPE_AUDIO) {

        if (CHECK_CODEC(sample_rate) ||

            CHECK_CODEC(channels) ||

            CHECK_CODEC(frame_size)) {

            http_log("Codec sample_rate, channels, frame_size do not match for VAR_2 %d\n", VAR_2);

            VAR_3 = 0;

        }

    } else {

        http_log("Unknown codec type for VAR_2 %d\n", VAR_2);

        VAR_3 = 0;

    }



    return VAR_3;

}

int FUNC_0(AVCodecContext *VAR_0, AVCodecContext *VAR_1, int VAR_2)
{ int VAR_3 = 1; #define CHECK_CODEC(x)  (VAR_0->x != VAR_1->x)
if (CHECK_CODEC(codec_id) || CHECK_CODEC(codec_type)) { http_log("Codecs do not match for VAR_2 %d\n", VAR_2); VAR_3 = 0; } else if (CHECK_CODEC(bit_rate) || CHECK_CODEC(flags)) { http_log("Codec bitrates do not match for VAR_2 %d\n", VAR_2); VAR_3 = 0; } else if (VAR_0->codec_type == AVMEDIA_TYPE_VIDEO) { if (CHECK_CODEC(time_base.den) ||
CHECK_CODEC(time_base.num) ||
CHECK_CODEC(width) ||
CHECK_CODEC(height)) { http_log("Codec width, height or framerate do not match for VAR_2 %d\n", VAR_2); VAR_3 = 0; } } else if (VAR_0->codec_type == AVMEDIA_TYPE_AUDIO) { if (CHECK_CODEC(sample_rate) ||
CHECK_CODEC(channels) ||
CHECK_CODEC(frame_size)) { http_log("Codec sample_rate, channels, frame_size do not match for VAR_2 %d\n", VAR_2); VAR_3 = 0; } } else { http_log("Unknown codec type for VAR_2 %d\n", VAR_2); VAR_3 = 0; } return VAR_3; }