summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-04 17:33:59 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2014-01-05 17:27:29 +0100
commit71b3235cea40623ece8e9f2d91cda0e1257ac3f7 (patch)
tree1b02971eb7abec99a66409f4810c0bb10b5a566c
parentdcd1acce1a69aebc36306a1155c025cc4175badc (diff)
downloadffmpeg-71b3235cea40623ece8e9f2d91cda0e1257ac3f7.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> (cherry picked from commit 5e0c7eab2a9d43e6e3be967ec1a6b04a3e0328da)
-rw-r--r--libavformat/oggdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 5cb03fe13a..e495a87bed 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -786,6 +786,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) {