duration = codec->frame_number * ((int64_t_C(10000000) * FRAME_RATE_BASE) / codec->frame_rate);
duration = av_rescale(codec->frame_number * codec->frame_rate_base, 10000000, codec->frame_rate);
static int asf_write_packet(AVFormatContext *s, int stream_index,                            uint8_t *buf, int size, int timestamp){    ASFContext *asf = s->priv_data;    ASFStream *stream;    int64_t duration;    AVCodecContext *codec;    codec = &s->streams[stream_index]->codec;    stream = &asf->streams[stream_index];    if (codec->codec_type == CODEC_TYPE_AUDIO) {        duration = (codec->frame_number * codec->frame_size * int64_t_C(10000000)) /            codec->sample_rate;    } else {        duration = codec->frame_number *            ((int64_t_C(10000000) * FRAME_RATE_BASE) / codec->frame_rate);    }    if (duration > asf->duration)        asf->duration = duration;    put_frame(s, stream, timestamp, buf, size);    return 0;}