static enum CodecID find_codec_or_die(const char *name, enum AVMediaType type, int encoder)

{

    const char *codec_string = encoder ? "encoder" : "decoder";

    AVCodec *codec;



    if(!name)

        return CODEC_ID_NONE;

    codec = encoder ?

        avcodec_find_encoder_by_name(name) :

        avcodec_find_decoder_by_name(name);

    if(!codec) {

        av_log(NULL, AV_LOG_FATAL, "Unknown %s '%s'\n", codec_string, name);

        exit_program(1);

    }

    if(codec->type != type) {

        av_log(NULL, AV_LOG_FATAL, "Invalid %s type '%s'\n", codec_string, name);

        exit_program(1);

    }

    return codec->id;

}

static enum CodecID find_codec_or_die(const char *name, enum AVMediaType type, int encoder)

{

    const char *codec_string = encoder ? "encoder" : "decoder";

    AVCodec *codec;



    if(!name)

        return CODEC_ID_NONE;

    codec = encoder ?

        avcodec_find_encoder_by_name(name) :

        avcodec_find_decoder_by_name(name);

    if(!codec) {

        av_log(NULL, AV_LOG_FATAL, "Unknown %s '%s'\n", codec_string, name);

        exit_program(1);

    }

    if(codec->type != type) {

        av_log(NULL, AV_LOG_FATAL, "Invalid %s type '%s'\n", codec_string, name);

        exit_program(1);

    }

    return codec->id;

}

static enum CodecID FUNC_0(const char *VAR_0, enum AVMediaType VAR_1, int VAR_2)

{

    const char *VAR_3 = VAR_2 ? "VAR_2" : "decoder";

    AVCodec *codec;



    if(!VAR_0)

        return CODEC_ID_NONE;

    codec = VAR_2 ?

        avcodec_find_encoder_by_name(VAR_0) :

        avcodec_find_decoder_by_name(VAR_0);

    if(!codec) {

        av_log(NULL, AV_LOG_FATAL, "Unknown %s '%s'\n", VAR_3, VAR_0);

        exit_program(1);

    }

    if(codec->VAR_1 != VAR_1) {

        av_log(NULL, AV_LOG_FATAL, "Invalid %s VAR_1 '%s'\n", VAR_3, VAR_0);

        exit_program(1);

    }

    return codec->id;

}

static enum CodecID FUNC_0(const char *VAR_0, enum AVMediaType VAR_1, int VAR_2)
{ const char *VAR_3 = VAR_2 ? "VAR_2" : "decoder"; AVCodec *codec; if(!VAR_0)
return CODEC_ID_NONE; codec = VAR_2 ?
avcodec_find_encoder_by_name(VAR_0) :
avcodec_find_decoder_by_name(VAR_0); if(!codec) { av_log(NULL, AV_LOG_FATAL, "Unknown %s '%s'\n", VAR_3, VAR_0); exit_program(1); } if(codec->VAR_1 != VAR_1) { av_log(NULL, AV_LOG_FATAL, "Invalid %s VAR_1 '%s'\n", VAR_3, VAR_0); exit_program(1); } return codec->id; }