static int nsv_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)

{

    NSVContext *nsv = s->priv_data;

    AVStream *st = s->streams[stream_index];

    NSVStream *nst = st->priv_data;

    int index;



    index = av_index_search_timestamp(st, timestamp, flags);

    if(index < 0)

        return -1;



    avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET);

    nst->frame_offset = st->index_entries[index].timestamp;

    nsv->state = NSV_UNSYNC;

    return 0;

}

static int nsv_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)

{

    NSVContext *nsv = s->priv_data;

    AVStream *st = s->streams[stream_index];

    NSVStream *nst = st->priv_data;

    int index;



    index = av_index_search_timestamp(st, timestamp, flags);

    if(index < 0)

        return -1;



    avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET);

    nst->frame_offset = st->index_entries[index].timestamp;

    nsv->state = NSV_UNSYNC;

    return 0;

}

    avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET);
static int FUNC_0(AVFormatContext *VAR_0, int VAR_1, int64_t VAR_2, int VAR_3)

{

    NSVContext *nsv = VAR_0->priv_data;

    AVStream *st = VAR_0->streams[VAR_1];

    NSVStream *nst = st->priv_data;

    int VAR_4;



    VAR_4 = av_index_search_timestamp(st, VAR_2, VAR_3);

    if(VAR_4 < 0)

        return -1;



    avio_seek(VAR_0->pb, st->index_entries[VAR_4].pos, SEEK_SET);

    nst->frame_offset = st->index_entries[VAR_4].VAR_2;

    nsv->state = NSV_UNSYNC;

    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, int VAR_1, int64_t VAR_2, int VAR_3)
{ NSVContext *nsv = VAR_0->priv_data; AVStream *st = VAR_0->streams[VAR_1]; NSVStream *nst = st->priv_data; int VAR_4; VAR_4 = av_index_search_timestamp(st, VAR_2, VAR_3); if(VAR_4 < 0)
return -1; avio_seek(VAR_0->pb, st->index_entries[VAR_4].pos, SEEK_SET); nst->frame_offset = st->index_entries[VAR_4].VAR_2; nsv->state = NSV_UNSYNC; return 0; }