diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-02-07 22:26:48 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-02-07 22:26:48 +0000 |
commit | 9bc932294f51bfcdc89225be11453b64d05dcce9 (patch) | |
tree | 410f50af99e44a14201597568994c02b7b046a07 /libavformat/asf-enc.c | |
parent | d09ea618ede31c4790c31f6f3f1a1c2d7192ed4c (diff) | |
download | ffmpeg-9bc932294f51bfcdc89225be11453b64d05dcce9.tar.gz |
muxing packets with unknown timestamps is not allowed
Originally committed as revision 7877 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/asf-enc.c')
-rw-r--r-- | libavformat/asf-enc.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/libavformat/asf-enc.c b/libavformat/asf-enc.c index 45f727bf47..211a144088 100644 --- a/libavformat/asf-enc.c +++ b/libavformat/asf-enc.c @@ -725,16 +725,8 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt) //XXX /FIXME use duration from AVPacket (quick hack by) 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); packet_st = asf->nb_packets; |