static char* mpjpeg_get_boundary(AVIOContext* pb)

{

    uint8_t *mime_type = NULL;

    const char *start;

    const char *end;

    uint8_t *res = NULL;

    int     len;



    /* get MIME type, and skip to the first parameter */

    av_opt_get(pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type);

    start = mime_type;

    while (start != NULL && *start != '\0') {

        start = strchr(start, ';');

        if (start)

            start = start+1;



        while (av_isspace(*start))

            start++;



        if (!av_stristart(start, "boundary=", &start)) {

            end = strchr(start, ';');

            if (end)

                len = end - start - 1;

            else

                len = strlen(start);

            res = av_strndup(start, len);

            break;

        }

    }



    av_freep(&mime_type);

    return res;

}

static char* mpjpeg_get_boundary(AVIOContext* pb)

{

    uint8_t *mime_type = NULL;

    const char *start;

    const char *end;

    uint8_t *res = NULL;

    int     len;



    

    av_opt_get(pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type);

    start = mime_type;

    while (start != NULL && *start != '\0') {

        start = strchr(start, ';');

        if (start)

            start = start+1;



        while (av_isspace(*start))

            start++;



        if (!av_stristart(start, "boundary=", &start)) {

            end = strchr(start, ';');

            if (end)

                len = end - start - 1;

            else

                len = strlen(start);

            res = av_strndup(start, len);

            break;

        }

    }



    av_freep(&mime_type);

    return res;

}

static char* FUNC_0(AVIOContext* VAR_0)

{

    uint8_t *mime_type = NULL;

    const char *VAR_1;

    const char *VAR_2;

    uint8_t *res = NULL;

    int     VAR_3;



    

    av_opt_get(VAR_0, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type);

    VAR_1 = mime_type;

    while (VAR_1 != NULL && *VAR_1 != '\0') {

        VAR_1 = strchr(VAR_1, ';');

        if (VAR_1)

            VAR_1 = VAR_1+1;



        while (av_isspace(*VAR_1))

            VAR_1++;



        if (!av_stristart(VAR_1, "boundary=", &VAR_1)) {

            VAR_2 = strchr(VAR_1, ';');

            if (VAR_2)

                VAR_3 = VAR_2 - VAR_1 - 1;

            else

                VAR_3 = strlen(VAR_1);

            res = av_strndup(VAR_1, VAR_3);

            break;

        }

    }



    av_freep(&mime_type);

    return res;

}

static char* FUNC_0(AVIOContext* VAR_0)
{ uint8_t *mime_type = NULL; const char *VAR_1; const char *VAR_2; uint8_t *res = NULL; int     VAR_3; av_opt_get(VAR_0, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type); VAR_1 = mime_type; while (VAR_1 != NULL && *VAR_1 != '\0') { VAR_1 = strchr(VAR_1, ';'); if (VAR_1)
VAR_1 = VAR_1+1; while (av_isspace(*VAR_1))
VAR_1++; if (!av_stristart(VAR_1, "boundary=", &VAR_1)) { VAR_2 = strchr(VAR_1, ';'); if (VAR_2)
VAR_3 = VAR_2 - VAR_1 - 1; else
VAR_3 = strlen(VAR_1); res = av_strndup(VAR_1, VAR_3); break; } } av_freep(&mime_type); return res; }