diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-04 17:33:59 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-04 18:39:42 +0100 |
commit | 5e0c7eab2a9d43e6e3be967ec1a6b04a3e0328da (patch) | |
tree | 9121362e85a587ff732847d1321ac35857db30f8 /libavformat/oggdec.c | |
parent | 863f4c3c7170270f78049e390670d2b83fbe67d3 (diff) | |
download | ffmpeg-5e0c7eab2a9d43e6e3be967ec1a6b04a3e0328da.tar.gz |
avformat/oggdec: dont read timestamps from EOS pages of ogm videos
Some muxers store invalid timestamps there, which breaks seeking
Fixes Ticket2739
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/oggdec.c')
-rw-r--r-- | libavformat/oggdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index 04405cf5a5..efb8f04a9c 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -808,6 +808,11 @@ static int64_t ogg_read_timestamp(AVFormatContext *s, int stream_index, && !ogg_packet(s, &i, &pstart, &psize, pos_arg)) { if (i == stream_index) { struct ogg_stream *os = ogg->streams + stream_index; + // Dont trust the last timestamps of a ogm video + if ( (os->flags & OGG_FLAG_EOS) + && !(os->flags & OGG_FLAG_BOS) + && os->codec == &ff_ogm_video_codec) + continue; pts = ogg_calc_pts(s, i, NULL); ogg_validate_keyframe(s, i, pstart, psize); if (os->pflags & AV_PKT_FLAG_KEY) { |