printf("filesz=%ld\n", size);
printf("filesz=%Ld\n", size);
int mov_read_header(AVFormatContext *s, AVFormatParameters *ap){    MOVContext *mov;    ByteIOContext *pb = &s->pb;    UINT32 tag, tag1;    int i, j, nb, bps, err;    INT64 size;    AVStream *st;    mov = malloc(sizeof(MOVContext));    if (!mov)        return -1;    memset(mov, 0, sizeof(MOVContext));    s->priv_data = mov;    mov->fc = s;    if(s->format->name[1] == 'p')        mov->mp4 = 1;    if(!url_is_streamed(pb)) /* .mov and .mp4 aren't streamable anyway (only progressive download if moov is before mdat) */        size = url_filesize(url_fileno(pb));    else        size = 0x7FFFFFFFFFFFFFFF;#ifdef DEBUG    printf("filesz=%ld\n", size);#endif    /* check MOV header */    err = parse_default(mov_default_parse_table, pb, 0L, 0LL, size, mov);    if(err<0 || (!mov->found_moov || !mov->found_mdat)) {        puts("header not found !!!");        exit(1);    }#ifdef DEBUG    printf("on_parse_exit_offset=%ld\n", url_ftell(pb));#endif    /* some cleanup : make sure we are on the mdat atom */    if(!url_is_streamed(pb) && (url_ftell(pb) != mov->mdat_offset))        url_fseek(pb, mov->mdat_offset, SEEK_SET);    mov->next_chunk_offset = mov->mdat_offset; /* initialise reading */#ifdef DEBUG    printf("mdat_reset_offset=%ld\n", url_ftell(pb));#endif#ifdef DEBUG    printf("streams= %ld\n", s->nb_streams);#endif    mov->total_streams = nb = s->nb_streams;    #if 1    for(i=0; i<s->nb_streams;) {        if(s->streams[i]->codec.codec_type == CODEC_TYPE_MOV_OTHER) {/* not audio, not video, delete */            free(s->streams[i]);            for(j=i+1; j<s->nb_streams; j++)                s->streams[j-1] = s->streams[j];            s->nb_streams--;        } else            i++;    }    for(i=0; i<s->nb_streams;i++) {        MOVStreamContext *sc;        sc = (MOVStreamContext *)s->streams[i]->priv_data;        sc->ffindex = i;        sc->is_ff_stream = 1;    }#endif#ifdef DEBUG    printf("real streams= %ld\n", s->nb_streams);#endif    return 0;}