if(mov->next_chunk_offset < offset)
if(mov->next_chunk_offset < offset) {
static int mov_read_packet(AVFormatContext *s, AVPacket *pkt){    MOVContext *mov = s->priv_data;    INT64 offset = 0x0FFFFFFFFFFFFFFF;    int i;    int st_id = 0, size;    size = 0x0FFFFFFF;    again:    for(i=0; i<mov->total_streams; i++) {/*        printf("%8ld ", mov->streams[i]->chunk_offsets[mov->streams[i]->next_chunk]); */        if((mov->streams[i]->next_chunk < mov->streams[i]->chunk_count)        && (mov->streams[i]->chunk_offsets[mov->streams[i]->next_chunk] < offset)) {/*            printf("y"); */            st_id = i;            offset = mov->streams[i]->chunk_offsets[mov->streams[i]->next_chunk];        }/*         else printf("n"); */    }    mov->streams[st_id]->next_chunk++;    if(offset==0x0FFFFFFFFFFFFFFF)        return -1;        if(mov->next_chunk_offset < offset) /* some meta data */        url_fskip(&s->pb, (offset - mov->next_chunk_offset));    if(!mov->streams[st_id]->is_ff_stream) {        url_fskip(&s->pb, (offset - mov->next_chunk_offset));        offset = 0x0FFFFFFFFFFFFFFF;/*        puts("*"); */        goto again;    }/* printf("\nchunk offset = %ld\n", offset); */    /* now get the chunk size... */    for(i=0; i<mov->total_streams; i++) {/*        printf("%ld ", mov->streams[i]->chunk_offsets[mov->streams[i]->next_chunk] - offset); */        if((mov->streams[i]->next_chunk < mov->streams[i]->chunk_count)        && ((mov->streams[i]->chunk_offsets[mov->streams[i]->next_chunk] - offset) < size)) {/*            printf("y"); */            size = mov->streams[i]->chunk_offsets[mov->streams[i]->next_chunk] - offset;        }/*         else printf("n"); */    }/* printf("\nchunk size = %ld\n", size); */    if(size == 0x0FFFFFFF)        size = mov->mdat_size + mov->mdat_offset - offset;    if(size < 0)        return -1;    if(size == 0)        return -1;    av_new_packet(pkt, size);    pkt->stream_index = mov->streams[st_id]->ffindex;    get_buffer(&s->pb, pkt->data, pkt->size);#ifdef DEBUG/*    printf("Packet (%d, %d, %ld) ", pkt->stream_index, st_id, pkt->size);    for(i=0; i<8; i++)        printf("%02x ", pkt->data[i]);    for(i=0; i<8; i++)        printf("%c ", (pkt->data[i]) & 0x7F);    puts("");*/#endif    mov->next_chunk_offset = offset + size;    return 0;}