if (fourcc_tag == LIST_TAG) {  get_le32(pb); fourcc_tag = get_le32(pb); size = get_le32(pb); }
static int fourxm_read_packet(AVFormatContext *s,                              AVPacket *pkt){    FourxmDemuxContext *fourxm = s->priv_data;    ByteIOContext *pb = &s->pb;    unsigned int fourcc_tag;    unsigned int size;    int ret = 0;    int track_number;    int packet_read = 0;    unsigned char header[8];    int64_t pts_inc;    while (!packet_read) {        if ((ret = get_buffer(&s->pb, header, 8)) < 0)            return ret;        fourcc_tag = LE_32(&header[0]);        size = LE_32(&header[4]);        if (fourcc_tag == LIST_TAG) {            /* skip the LIST-FRAM tag and get the next fourcc */            get_le32(pb);            fourcc_tag = get_le32(pb);            size = get_le32(pb);        }        if (url_feof(pb))            return -EIO;        switch (fourcc_tag) {        case ifrm_TAG:        case pfrm_TAG:        case cfrm_TAG:{int id, whole;static int stats[1000];            /* bump the pts if this last data sent out was audio */            if (fourxm->last_chunk_was_audio) {                fourxm->last_chunk_was_audio = 0;                pts_inc = fourxm->last_audio_frame_count;                pts_inc *= 90000;                pts_inc /= fourxm->tracks[fourxm->selected_track].sample_rate;                fourxm->pts += pts_inc;            }            /* allocate 8 more bytes than 'size' to account for fourcc             * and size */            if (av_new_packet(pkt, size + 8))                return -EIO;            pkt->stream_index = fourxm->video_stream_index;            pkt->pts = fourxm->pts;            memcpy(pkt->data, header, 8);            ret = get_buffer(&s->pb, &pkt->data[8], size);if (fourcc_tag == cfrm_TAG) {id = LE_32(&pkt->data[12]);whole = LE_32(&pkt->data[16]);stats[id] += size - 12;printf(" cfrm chunk id:%d size:%d whole:%d until now:%d\n", id, size, whole, stats[id]);}            if (ret < 0)                av_free_packet(pkt);            else                packet_read = 1;            break;        }        case snd__TAG:printf (" snd_ chunk, ");            track_number = get_le32(pb);            size = get_le32(pb);            if (track_number == fourxm->selected_track) {printf ("correct track, dispatching...\n");                if (av_new_packet(pkt, size))                    return -EIO;                pkt->stream_index =                     fourxm->tracks[fourxm->selected_track].stream_index;                pkt->pts = fourxm->pts;                ret = get_buffer(&s->pb, pkt->data, size);                if (ret < 0)                    av_free_packet(pkt);                else                    packet_read = 1;                /* maintain pts info for the benefit of the video track */                fourxm->last_chunk_was_audio = 1;                fourxm->last_audio_frame_count = size /                    ((fourxm->tracks[fourxm->selected_track].bits / 8) *                      fourxm->tracks[fourxm->selected_track].channels);            } else {printf ("wrong track, skipping...\n");                url_fseek(pb, size, SEEK_CUR);            }            break;        default:            url_fseek(pb, size, SEEK_CUR);            break;        }    }    return ret;}