int ffurl_connect(URLContext *uc, AVDictionary **options)

{

    int err =

        uc->prot->url_open2 ? uc->prot->url_open2(uc,

                                                  uc->filename,

                                                  uc->flags,

                                                  options) :

        uc->prot->url_open(uc, uc->filename, uc->flags);

    if (err)

        return err;

    uc->is_connected = 1;

    /* We must be careful here as ffurl_seek() could be slow,

     * for example for http */

    if ((uc->flags & AVIO_FLAG_WRITE) || !strcmp(uc->prot->name, "file"))

        if (!uc->is_streamed && ffurl_seek(uc, 0, SEEK_SET) < 0)

            uc->is_streamed = 1;

    return 0;

}

int ffurl_connect(URLContext *uc, AVDictionary **options)

{

    int err =

        uc->prot->url_open2 ? uc->prot->url_open2(uc,

                                                  uc->filename,

                                                  uc->flags,

                                                  options) :

        uc->prot->url_open(uc, uc->filename, uc->flags);

    if (err)

        return err;

    uc->is_connected = 1;

    



    if ((uc->flags & AVIO_FLAG_WRITE) || !strcmp(uc->prot->name, "file"))

        if (!uc->is_streamed && ffurl_seek(uc, 0, SEEK_SET) < 0)

            uc->is_streamed = 1;

    return 0;

}

int FUNC_0(URLContext *VAR_0, AVDictionary **VAR_1)

{

    int VAR_2 =

        VAR_0->prot->url_open2 ? VAR_0->prot->url_open2(VAR_0,

                                                  VAR_0->filename,

                                                  VAR_0->flags,

                                                  VAR_1) :

        VAR_0->prot->url_open(VAR_0, VAR_0->filename, VAR_0->flags);

    if (VAR_2)

        return VAR_2;

    VAR_0->is_connected = 1;

    



    if ((VAR_0->flags & AVIO_FLAG_WRITE) || !strcmp(VAR_0->prot->name, "file"))

        if (!VAR_0->is_streamed && ffurl_seek(VAR_0, 0, SEEK_SET) < 0)

            VAR_0->is_streamed = 1;

    return 0;

}

int FUNC_0(URLContext *VAR_0, AVDictionary **VAR_1)
{ int VAR_2 =
VAR_0->prot->url_open2 ? VAR_0->prot->url_open2(VAR_0,
VAR_0->filename,
VAR_0->flags,
VAR_1) :
VAR_0->prot->url_open(VAR_0, VAR_0->filename, VAR_0->flags); if (VAR_2)
return VAR_2; VAR_0->is_connected = 1; if ((VAR_0->flags & AVIO_FLAG_WRITE) || !strcmp(VAR_0->prot->name, "file"))
if (!VAR_0->is_streamed && ffurl_seek(VAR_0, 0, SEEK_SET) < 0)
VAR_0->is_streamed = 1; return 0; }