[FFmpeg-cvslog] avformat/oggdec: dont read timestamps from EOS pages of ogm videos

Michael Niedermayer git at videolan.org
Sat Jan 4 19:20:52 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jan  4 17:33:59 2014 +0100| [5e0c7eab2a9d43e6e3be967ec1a6b04a3e0328da] | committer: Michael Niedermayer

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 at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5e0c7eab2a9d43e6e3be967ec1a6b04a3e0328da
---

 libavformat/oggdec.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 04405cf..efb8f04 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) {



More information about the ffmpeg-cvslog mailing list