aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-01-30 22:55:12 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-01-30 22:55:12 +0000
commitc55806e3a273b643f6e34c9806881fa2c777af0b (patch)
treec85d93ea34e9907c0e08667d52bd92b274962a53 /libavformat/utils.c
parent6299a22904d00d6d628eaa7ab0c648f70dfa970d (diff)
downloadffmpeg-c55806e3a273b643f6e34c9806881fa2c777af0b.tar.gz
Flag to ignore dts on frames that contain pts.
This works around common issues with mpeg-ps files with broken timestamps. Also allows playing the broken sample from issue1024. Originally committed as revision 21562 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index c15b5f1cf0..260dc7641c 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -808,6 +808,9 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
int num, den, presentation_delayed, delay, i;
int64_t offset;
+ if((s->flags & AVFMT_FLAG_IGNDTS) && pkt->pts != AV_NOPTS_VALUE)
+ pkt->dts= AV_NOPTS_VALUE;
+
if (st->codec->codec_id != CODEC_ID_H264 && pc && pc->pict_type == FF_B_TYPE)
//FIXME Set low_delay = 0 when has_b_frames = 1
st->codec->has_b_frames = 1;