diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-07-08 14:07:37 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-07-08 14:07:37 +0000 |
commit | 6d77d9acf7c505bb23948fa4e84b9ea236652772 (patch) | |
tree | a5e336d3e01a47977ad06d8f5f1aa22e08d9f220 /libavformat/utils.c | |
parent | 69cec4e32d833e39c251522a5bb1807f1c8c765a (diff) | |
download | ffmpeg-6d77d9acf7c505bb23948fa4e84b9ea236652772.tar.gz |
Set cur_dts to 0 only during creating new streams and not every time cur_dts happens
to be AV_NOPTS_VALUE.
Originally committed as revision 14118 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index affb9125bc..671595b4af 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -730,10 +730,6 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, if(pkt->dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && pkt->pts > pkt->dts) presentation_delayed = 1; - if(st->cur_dts == AV_NOPTS_VALUE){ - st->cur_dts = 0; //FIXME maybe set it to 0 during init - } - // av_log(NULL, AV_LOG_DEBUG, "IN delayed:%d pts:%"PRId64", dts:%"PRId64" cur_dts:%"PRId64" st:%d pc:%p\n", presentation_delayed, pkt->pts, pkt->dts, st->cur_dts, pkt->stream_index, pc); /* interpolate PTS and DTS if they are not present */ if(delay==0 || (delay==1 && pc)){ @@ -2263,7 +2259,11 @@ AVStream *av_new_stream(AVFormatContext *s, int id) st->id = id; st->start_time = AV_NOPTS_VALUE; st->duration = AV_NOPTS_VALUE; - st->cur_dts = AV_NOPTS_VALUE; + /* we set the current DTS to 0 so that formats without any timestamps + but durations get some timestamps, formats with some unknown + timestamps have their first few packets buffered and the + timestamps corrected before they are returned to the user */ + st->cur_dts = 0; st->first_dts = AV_NOPTS_VALUE; /* default pts setting is MPEG-like */ |