printf (" dispatching %s frame with %d bytes and pts %lld (%0.1f sec)\n",
av_log(NULL, AV_LOG_INFO, " dispatching %s frame with %d bytes and pts %lld (%0.1f sec)\n",
static int vmd_read_packet(AVFormatContext *s,                           AVPacket *pkt){    VmdDemuxContext *vmd = (VmdDemuxContext *)s->priv_data;    ByteIOContext *pb = &s->pb;    int ret = 0;    vmd_frame_t *frame;    if (vmd->current_frame >= vmd->frame_count)        return AVERROR_IO;    frame = &vmd->frame_table[vmd->current_frame];    /* position the stream (will probably be there already) */    url_fseek(pb, frame->frame_offset, SEEK_SET);    if (av_new_packet(pkt, frame->frame_size + BYTES_PER_FRAME_RECORD))        return AVERROR_NOMEM;    pkt->pos= url_ftell(pb);    memcpy(pkt->data, frame->frame_record, BYTES_PER_FRAME_RECORD);    ret = get_buffer(pb, pkt->data + BYTES_PER_FRAME_RECORD,         frame->frame_size);    if (ret != frame->frame_size) {        av_free_packet(pkt);        ret = AVERROR_IO;    }    pkt->stream_index = frame->stream_index;    if (frame->frame_record[0] == 0x02)        pkt->pts = frame->pts;    else {        pkt->pts = vmd->audio_sample_counter;        pkt->pts *= 90000;        pkt->pts /= vmd->sample_rate;//        pkt->pts /= vmd->audio_frame_divisor;        vmd->audio_sample_counter += vmd_calculate_audio_duration(            pkt->data, pkt->size, vmd->audio_block_align);    }printf (" dispatching %s frame with %d bytes and pts %lld (%0.1f sec)\n",  (frame->frame_record[0] == 0x02) ? "video" : "audio",  frame->frame_size + BYTES_PER_FRAME_RECORD,  pkt->pts, (float)(pkt->pts / 90000.0));    vmd->current_frame++;    return ret;}