static int recover(WtvContext *wtv, uint64_t broken_pos)

{

    AVIOContext *pb = wtv->pb;

    int i;

    for (i = 0; i < wtv->nb_index_entries; i++) {

        if (wtv->index_entries[i].pos > broken_pos) {

            int ret = avio_seek(pb, wtv->index_entries[i].pos, SEEK_SET);

            if (ret < 0)

                return ret;

            wtv->pts = wtv->index_entries[i].timestamp;

            return 0;

         }

     }

     return AVERROR(EIO);

}

static int recover(WtvContext *wtv, uint64_t broken_pos)

{

    AVIOContext *pb = wtv->pb;

    int i;

    for (i = 0; i < wtv->nb_index_entries; i++) {

        if (wtv->index_entries[i].pos > broken_pos) {

            int ret = avio_seek(pb, wtv->index_entries[i].pos, SEEK_SET);

            if (ret < 0)

                return ret;

            wtv->pts = wtv->index_entries[i].timestamp;

            return 0;

         }

     }

     return AVERROR(EIO);

}

            int ret = avio_seek(pb, wtv->index_entries[i].pos, SEEK_SET);
static int FUNC_0(WtvContext *VAR_0, uint64_t VAR_1)

{

    AVIOContext *pb = VAR_0->pb;

    int VAR_2;

    for (VAR_2 = 0; VAR_2 < VAR_0->nb_index_entries; VAR_2++) {

        if (VAR_0->index_entries[VAR_2].pos > VAR_1) {

            int ret = avio_seek(pb, VAR_0->index_entries[VAR_2].pos, SEEK_SET);

            if (ret < 0)

                return ret;

            VAR_0->pts = VAR_0->index_entries[VAR_2].timestamp;

            return 0;

         }

     }

     return AVERROR(EIO);

}

static int FUNC_0(WtvContext *VAR_0, uint64_t VAR_1)
{ AVIOContext *pb = VAR_0->pb; int VAR_2; for (VAR_2 = 0; VAR_2 < VAR_0->nb_index_entries; VAR_2++) { if (VAR_0->index_entries[VAR_2].pos > VAR_1) { int ret = avio_seek(pb, VAR_0->index_entries[VAR_2].pos, SEEK_SET); if (ret < 0)
return ret; VAR_0->pts = VAR_0->index_entries[VAR_2].timestamp; return 0; } } return AVERROR(EIO); }