static int get_preset_file_2(const char *preset_name, const char *codec_name, AVIOContext **s)

{

    int i, ret = 1;

    char filename[1000];

    const char *base[3] = { getenv("AVCONV_DATADIR"),

                            getenv("HOME"),

                            AVCONV_DATADIR,

                            };



    for (i = 0; i < FF_ARRAY_ELEMS(base) && ret; i++) {

        if (!base[i])

            continue;

        if (codec_name) {

            snprintf(filename, sizeof(filename), "%s%s/%s-%s.avpreset", base[i],

                     i != 1 ? "" : "/.avconv", codec_name, preset_name);

            ret = avio_open2(s, filename, AVIO_FLAG_READ, &int_cb, NULL);

        }

        if (ret) {

            snprintf(filename, sizeof(filename), "%s%s/%s.avpreset", base[i],

                     i != 1 ? "" : "/.avconv", preset_name);

            ret = avio_open2(s, filename, AVIO_FLAG_READ, &int_cb, NULL);

        }

    }

    return ret;

}

static int get_preset_file_2(const char *preset_name, const char *codec_name, AVIOContext **s)

{

    int i, ret = 1;

    char filename[1000];

    const char *base[3] = { getenv("AVCONV_DATADIR"),

                            getenv("HOME"),

                            AVCONV_DATADIR,

                            };



    for (i = 0; i < FF_ARRAY_ELEMS(base) && ret; i++) {

        if (!base[i])

            continue;

        if (codec_name) {

            snprintf(filename, sizeof(filename), "%s%s/%s-%s.avpreset", base[i],

                     i != 1 ? "" : "/.avconv", codec_name, preset_name);

            ret = avio_open2(s, filename, AVIO_FLAG_READ, &int_cb, NULL);

        }

        if (ret) {

            snprintf(filename, sizeof(filename), "%s%s/%s.avpreset", base[i],

                     i != 1 ? "" : "/.avconv", preset_name);

            ret = avio_open2(s, filename, AVIO_FLAG_READ, &int_cb, NULL);

        }

    }

    return ret;

}

static int FUNC_0(const char *VAR_0, const char *VAR_1, AVIOContext **VAR_2)

{

    int VAR_3, VAR_4 = 1;

    char VAR_5[1000];

    const char *VAR_6[3] = { getenv("AVCONV_DATADIR"),

                            getenv("HOME"),

                            AVCONV_DATADIR,

                            };



    for (VAR_3 = 0; VAR_3 < FF_ARRAY_ELEMS(VAR_6) && VAR_4; VAR_3++) {

        if (!VAR_6[VAR_3])

            continue;

        if (VAR_1) {

            snprintf(VAR_5, sizeof(VAR_5), "%VAR_2%VAR_2/%VAR_2-%VAR_2.avpreset", VAR_6[VAR_3],

                     VAR_3 != 1 ? "" : "/.avconv", VAR_1, VAR_0);

            VAR_4 = avio_open2(VAR_2, VAR_5, AVIO_FLAG_READ, &int_cb, NULL);

        }

        if (VAR_4) {

            snprintf(VAR_5, sizeof(VAR_5), "%VAR_2%VAR_2/%VAR_2.avpreset", VAR_6[VAR_3],

                     VAR_3 != 1 ? "" : "/.avconv", VAR_0);

            VAR_4 = avio_open2(VAR_2, VAR_5, AVIO_FLAG_READ, &int_cb, NULL);

        }

    }

    return VAR_4;

}

static int FUNC_0(const char *VAR_0, const char *VAR_1, AVIOContext **VAR_2)
{ int VAR_3, VAR_4 = 1; char VAR_5[1000]; const char *VAR_6[3] = { getenv("AVCONV_DATADIR"), getenv("HOME"),
AVCONV_DATADIR,
}; for (VAR_3 = 0; VAR_3 < FF_ARRAY_ELEMS(VAR_6) && VAR_4; VAR_3++) { if (!VAR_6[VAR_3])
continue; if (VAR_1) { snprintf(VAR_5, sizeof(VAR_5), "%VAR_2%VAR_2/%VAR_2-%VAR_2.avpreset", VAR_6[VAR_3],
VAR_3 != 1 ? "" : "/.avconv", VAR_1, VAR_0); VAR_4 = avio_open2(VAR_2, VAR_5, AVIO_FLAG_READ, &int_cb, NULL); } if (VAR_4) { snprintf(VAR_5, sizeof(VAR_5), "%VAR_2%VAR_2/%VAR_2.avpreset", VAR_6[VAR_3],
VAR_3 != 1 ? "" : "/.avconv", VAR_0); VAR_4 = avio_open2(VAR_2, VAR_5, AVIO_FLAG_READ, &int_cb, NULL); } } return VAR_4; }