static int ffserver_opt_preset(const char *arg,

                       AVCodecContext *avctx, int type,

                       enum AVCodecID *audio_id, enum AVCodecID *video_id)

{

    FILE *f=NULL;

    char filename[1000], tmp[1000], tmp2[1000], line[1000];

    int ret = 0;

    AVCodec *codec = avcodec_find_encoder(avctx->codec_id);



    if (!(f = get_preset_file(filename, sizeof(filename), arg, 0,

                              codec ? codec->name : NULL))) {

        fprintf(stderr, "File for preset '%s' not found\n", arg);

        return 1;

    }



    while(!feof(f)){

        int e= fscanf(f, "%999[^\n]\n", line) - 1;

        if(line[0] == '#' && !e)

            continue;

        e|= sscanf(line, "%999[^=]=%999[^\n]\n", tmp, tmp2) - 2;

        if(e){

            fprintf(stderr, "%s: Invalid syntax: '%s'\n", filename, line);

            ret = 1;

            break;

        }

        if(!strcmp(tmp, "acodec")){

            *audio_id = opt_codec(tmp2, AVMEDIA_TYPE_AUDIO);

        }else if(!strcmp(tmp, "vcodec")){

            *video_id = opt_codec(tmp2, AVMEDIA_TYPE_VIDEO);

        }else if(!strcmp(tmp, "scodec")){

            /* opt_subtitle_codec(tmp2); */

        }else if(ffserver_opt_default(tmp, tmp2, avctx, type) < 0){

            fprintf(stderr, "%s: Invalid option or argument: '%s', parsed as '%s' = '%s'\n", filename, line, tmp, tmp2);

            ret = 1;

            break;

        }

    }



    fclose(f);



    return ret;

}

static int ffserver_opt_preset(const char *arg,

                       AVCodecContext *avctx, int type,

                       enum AVCodecID *audio_id, enum AVCodecID *video_id)

{

    FILE *f=NULL;

    char filename[1000], tmp[1000], tmp2[1000], line[1000];

    int ret = 0;

    AVCodec *codec = avcodec_find_encoder(avctx->codec_id);



    if (!(f = get_preset_file(filename, sizeof(filename), arg, 0,

                              codec ? codec->name : NULL))) {

        fprintf(stderr, "File for preset '%s' not found\n", arg);

        return 1;

    }



    while(!feof(f)){

        int e= fscanf(f, "%999[^\n]\n", line) - 1;

        if(line[0] == '#' && !e)

            continue;

        e|= sscanf(line, "%999[^=]=%999[^\n]\n", tmp, tmp2) - 2;

        if(e){

            fprintf(stderr, "%s: Invalid syntax: '%s'\n", filename, line);

            ret = 1;

            break;

        }

        if(!strcmp(tmp, "acodec")){

            *audio_id = opt_codec(tmp2, AVMEDIA_TYPE_AUDIO);

        }else if(!strcmp(tmp, "vcodec")){

            *video_id = opt_codec(tmp2, AVMEDIA_TYPE_VIDEO);

        }else if(!strcmp(tmp, "scodec")){

            

        }else if(ffserver_opt_default(tmp, tmp2, avctx, type) < 0){

            fprintf(stderr, "%s: Invalid option or argument: '%s', parsed as '%s' = '%s'\n", filename, line, tmp, tmp2);

            ret = 1;

            break;

        }

    }



    fclose(f);



    return ret;

}

static int FUNC_0(const char *VAR_0,

                       AVCodecContext *VAR_1, int VAR_2,

                       enum AVCodecID *VAR_3, enum AVCodecID *VAR_4)

{

    FILE *f=NULL;

    char VAR_5[1000], VAR_6[1000], VAR_7[1000], VAR_8[1000];

    int VAR_9 = 0;

    AVCodec *codec = avcodec_find_encoder(VAR_1->codec_id);



    if (!(f = get_preset_file(VAR_5, sizeof(VAR_5), VAR_0, 0,

                              codec ? codec->name : NULL))) {

        fprintf(stderr, "File for preset '%s' not found\n", VAR_0);

        return 1;

    }



    while(!feof(f)){

        int VAR_10= fscanf(f, "%999[^\n]\n", VAR_8) - 1;

        if(VAR_8[0] == '#' && !VAR_10)

            continue;

        VAR_10|= sscanf(VAR_8, "%999[^=]=%999[^\n]\n", VAR_6, VAR_7) - 2;

        if(VAR_10){

            fprintf(stderr, "%s: Invalid syntax: '%s'\n", VAR_5, VAR_8);

            VAR_9 = 1;

            break;

        }

        if(!strcmp(VAR_6, "acodec")){

            *VAR_3 = opt_codec(VAR_7, AVMEDIA_TYPE_AUDIO);

        }else if(!strcmp(VAR_6, "vcodec")){

            *VAR_4 = opt_codec(VAR_7, AVMEDIA_TYPE_VIDEO);

        }else if(!strcmp(VAR_6, "scodec")){

            

        }else if(ffserver_opt_default(VAR_6, VAR_7, VAR_1, VAR_2) < 0){

            fprintf(stderr, "%s: Invalid option or argument: '%s', parsed as '%s' = '%s'\n", VAR_5, VAR_8, VAR_6, VAR_7);

            VAR_9 = 1;

            break;

        }

    }



    fclose(f);



    return VAR_9;

}

static int FUNC_0(const char *VAR_0,
AVCodecContext *VAR_1, int VAR_2,
enum AVCodecID *VAR_3, enum AVCodecID *VAR_4)
{ FILE *f=NULL; char VAR_5[1000], VAR_6[1000], VAR_7[1000], VAR_8[1000]; int VAR_9 = 0; AVCodec *codec = avcodec_find_encoder(VAR_1->codec_id); if (!(f = get_preset_file(VAR_5, sizeof(VAR_5), VAR_0, 0,
codec ? codec->name : NULL))) { fprintf(stderr, "File for preset '%s' not found\n", VAR_0); return 1; } while(!feof(f)){ int VAR_10= fscanf(f, "%999[^\n]\n", VAR_8) - 1; if(VAR_8[0] == '#' && !VAR_10)
continue; VAR_10|= sscanf(VAR_8, "%999[^=]=%999[^\n]\n", VAR_6, VAR_7) - 2; if(VAR_10){ fprintf(stderr, "%s: Invalid syntax: '%s'\n", VAR_5, VAR_8); VAR_9 = 1; break; } if(!strcmp(VAR_6, "acodec")){ *VAR_3 = opt_codec(VAR_7, AVMEDIA_TYPE_AUDIO); }else if(!strcmp(VAR_6, "vcodec")){ *VAR_4 = opt_codec(VAR_7, AVMEDIA_TYPE_VIDEO); }else if(!strcmp(VAR_6, "scodec")){ }else if(ffserver_opt_default(VAR_6, VAR_7, VAR_1, VAR_2) < 0){ fprintf(stderr, "%s: Invalid option or argument: '%s', parsed as '%s' = '%s'\n", VAR_5, VAR_8, VAR_6, VAR_7); VAR_9 = 1; break; } } fclose(f); return VAR_9; }