printf("frames/samples = %ld\n", frames_per_sample);
printf("frames/samples = %d\n", frames_per_sample);
static int parse_stsd(MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param){    MOVContext *c;    int entries, size, samp_sz, frames_per_sample;    char *buf;    UINT32 format;    AVStream *st;#ifdef DEBUG    print_atom("stsd", atom_type, atom_offset, atom_size);#endif    c = (MOVContext *)param;    st = c->fc->streams[c->fc->nb_streams-1];    get_byte(pb); /* version */    get_byte(pb); get_byte(pb); get_byte(pb); /* flags */    entries = get_be32(pb);    while(entries--) {        size = get_be32(pb); /* size */        format = get_le32(pb); /* data format */                get_be32(pb); /* reserved */        get_be16(pb); /* reserved */        get_be16(pb); /* index *//*        if(format == MKTAG('m', 'p', '4', 'v')) *//*            st->codec.codec_type=CODEC_TYPE_VIDEO; *//* force things (XXX: was this for .mp4 ?) */        if(st->codec.codec_type==CODEC_TYPE_VIDEO) {            st->codec.codec_tag = format;            st->codec.codec_id = codec_get_id(mov_video_tags, format);            get_be16(pb); /* version */            get_be16(pb); /* revision level */            get_be32(pb); /* vendor */            get_be32(pb); /* temporal quality */            get_be32(pb); /* spacial quality */            st->codec.width = get_be16(pb); /* width */            st->codec.height = get_be16(pb); /* height */            get_be32(pb); /* horiz resolution */            get_be32(pb); /* vert resolution */            get_be32(pb); /* data size, always 0 */            frames_per_sample = get_be16(pb); /* frame per samples */#ifdef DEBUG            printf("frames/samples = %ld\n", frames_per_sample);#endif            url_fskip(pb, 32); /* codec name */            get_be16(pb); /* depth */            get_be16(pb); /* colortable id */            get_be16(pb); /*  */            get_be16(pb); /*  */                        st->codec.sample_rate = 25 * FRAME_RATE_BASE;                        if(size > 16)                url_fskip(pb, size-(16+24+18+32));        } else {            st->codec.codec_tag = format;            get_be16(pb); /* version */            get_be16(pb); /* revision level */            get_be32(pb); /* vendor */            st->codec.channels = get_be16(pb);/* channel count */            samp_sz = get_be16(pb); /* sample size */#ifdef DEBUG            if(samp_sz != 16)                puts("!!! stsd: audio sample size is not 16 bit !");#endif                        st->codec.codec_id = codec_get_id(mov_audio_tags, format);            /* handle specific s8 codec */            if (st->codec.codec_id == CODEC_ID_PCM_S16BE && samp_sz == 8)            st->codec.codec_id = CODEC_ID_PCM_S8;            get_be16(pb); /* compression id = 0*/            get_be16(pb); /* packet size = 0 */                        st->codec.sample_rate = ((get_be32(pb) >> 16));            st->codec.bit_rate = 0;            /* this is for .mp4 files */            if(format == MKTAG('m', 'p', '4', 'v')) { /* XXX */                st->codec.codec_type=CODEC_TYPE_VIDEO; /* force things */                st->codec.codec_id = CODEC_ID_MPEG4;                st->codec.frame_rate = 25;                st->codec.bit_rate = 100000;            }#if 0            get_be16(pb); get_be16(pb); /*  */            get_be16(pb); /*  */            get_be16(pb); /*  */            get_be16(pb); /*  */            get_be16(pb); /*  */#endif                        if(size > 16)                url_fskip(pb, size-(16+20));        }#ifdef DEBUG        printf("4CC= %c%c%c%c\n", *((char *)&format), ((char *)&format)[1], ((char *)&format)[2], ((char *)&format)[3]);#endif    }/*    if(len) {        buf = malloc(len+1);        get_buffer(pb, buf, len);        buf[len] = '\0';        puts(buf);        free(buf);    }*/    return 0;}