static int nsv_read_header(AVFormatContext *s)

{

    NSVContext *nsv = s->priv_data;

    int i, err;



    av_dlog(s, "%s()\n", __FUNCTION__);

    av_dlog(s, "filename '%s'\n", s->filename);



    nsv->state = NSV_UNSYNC;

    nsv->ahead[0].data = nsv->ahead[1].data = NULL;



    for (i = 0; i < NSV_MAX_RESYNC_TRIES; i++) {

        if (nsv_resync(s) < 0)

            return -1;

        if (nsv->state == NSV_FOUND_NSVF)

            err = nsv_parse_NSVf_header(s);

            /* we need the first NSVs also... */

        if (nsv->state == NSV_FOUND_NSVS) {

            err = nsv_parse_NSVs_header(s);

            break; /* we just want the first one */

        }

    }

    if (s->nb_streams < 1) /* no luck so far */

        return -1;

    /* now read the first chunk, so we can attempt to decode more info */

    err = nsv_read_chunk(s, 1);



    av_dlog(s, "parsed header\n");

    return err;

}

static int nsv_read_header(AVFormatContext *s)

{

    NSVContext *nsv = s->priv_data;

    int i, err;



    av_dlog(s, "%s()\n", __FUNCTION__);

    av_dlog(s, "filename '%s'\n", s->filename);



    nsv->state = NSV_UNSYNC;

    nsv->ahead[0].data = nsv->ahead[1].data = NULL;



    for (i = 0; i < NSV_MAX_RESYNC_TRIES; i++) {

        if (nsv_resync(s) < 0)

            return -1;

        if (nsv->state == NSV_FOUND_NSVF)

            err = nsv_parse_NSVf_header(s);

            

        if (nsv->state == NSV_FOUND_NSVS) {

            err = nsv_parse_NSVs_header(s);

            break; 

        }

    }

    if (s->nb_streams < 1) 

        return -1;

    

    err = nsv_read_chunk(s, 1);



    av_dlog(s, "parsed header\n");

    return err;

}

        if (nsv->state == NSV_FOUND_NSVF)
static int FUNC_0(AVFormatContext *VAR_0)

{

    NSVContext *nsv = VAR_0->priv_data;

    int VAR_1, VAR_2;



    av_dlog(VAR_0, "%VAR_0()\n", __FUNCTION__);

    av_dlog(VAR_0, "filename '%VAR_0'\n", VAR_0->filename);



    nsv->state = NSV_UNSYNC;

    nsv->ahead[0].data = nsv->ahead[1].data = NULL;



    for (VAR_1 = 0; VAR_1 < NSV_MAX_RESYNC_TRIES; VAR_1++) {

        if (nsv_resync(VAR_0) < 0)

            return -1;

        if (nsv->state == NSV_FOUND_NSVF)

            VAR_2 = nsv_parse_NSVf_header(VAR_0);

            

        if (nsv->state == NSV_FOUND_NSVS) {

            VAR_2 = nsv_parse_NSVs_header(VAR_0);

            break; 

        }

    }

    if (VAR_0->nb_streams < 1) 

        return -1;

    

    VAR_2 = nsv_read_chunk(VAR_0, 1);



    av_dlog(VAR_0, "parsed header\n");

    return VAR_2;

}

static int FUNC_0(AVFormatContext *VAR_0)
{ NSVContext *nsv = VAR_0->priv_data; int VAR_1, VAR_2; av_dlog(VAR_0, "%VAR_0()\n", __FUNCTION__); av_dlog(VAR_0, "filename '%VAR_0'\n", VAR_0->filename); nsv->state = NSV_UNSYNC; nsv->ahead[0].data = nsv->ahead[1].data = NULL; for (VAR_1 = 0; VAR_1 < NSV_MAX_RESYNC_TRIES; VAR_1++) { if (nsv_resync(VAR_0) < 0)
return -1; if (nsv->state == NSV_FOUND_NSVF)
VAR_2 = nsv_parse_NSVf_header(VAR_0); if (nsv->state == NSV_FOUND_NSVS) { VAR_2 = nsv_parse_NSVs_header(VAR_0); break; } } if (VAR_0->nb_streams < 1)
return -1; VAR_2 = nsv_read_chunk(VAR_0, 1); av_dlog(VAR_0, "parsed header\n"); return VAR_2; }