Browse Source

muxing packets with unknown timestamps is not allowed

Originally committed as revision 7877 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer 18 years ago
parent
commit
9bc932294f
1 changed files with 2 additions and 10 deletions
  1. +2
    -10
      libavformat/asf-enc.c

+ 2
- 10
libavformat/asf-enc.c View File

@@ -725,16 +725,8 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt)


//XXX /FIXME use duration from AVPacket (quick hack by) //XXX /FIXME use duration from AVPacket (quick hack by)
pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts; pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts;
if (pts == AV_NOPTS_VALUE) {
if (codec->codec_type == CODEC_TYPE_AUDIO) {
duration = (codec->frame_number * (int64_t)codec->frame_size * INT64_C(10000000)) /
codec->sample_rate;
} else {
duration = av_rescale(codec->frame_number * (int64_t)codec->time_base.num, 10000000, codec->time_base.den);
}
} else {
duration = pts * 10000;
}
assert(pts != AV_NOPTS_VALUE);
duration = pts * 10000;
asf->duration= FFMAX(asf->duration, duration); asf->duration= FFMAX(asf->duration, duration);


packet_st = asf->nb_packets; packet_st = asf->nb_packets;


Loading…
Cancel
Save