summaryrefslogtreecommitdiffstats
path: root/libavformat/oggparsevp8.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/oggparsevp8.c')
-rw-r--r--libavformat/oggparsevp8.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libavformat/oggparsevp8.c b/libavformat/oggparsevp8.c
index f38cc56..c534ab1 100644
--- a/libavformat/oggparsevp8.c
+++ b/libavformat/oggparsevp8.c
@@ -2,20 +2,20 @@
* On2 VP8 parser for Ogg
* Copyright (C) 2013 James Almer
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -82,7 +82,11 @@ static uint64_t vp8_gptopts(AVFormatContext *s, int idx,
struct ogg *ogg = s->priv_data;
struct ogg_stream *os = ogg->streams + idx;
- uint64_t pts = (granule >> 32);
+ int invcnt = !((granule >> 30) & 3);
+ // If page granule is that of an invisible vp8 frame, its pts will be
+ // that of the end of the next visible frame. We subtract 1 for those
+ // to prevent messing up pts calculations.
+ uint64_t pts = (granule >> 32) - invcnt;
uint32_t dist = (granule >> 3) & 0x07ffffff;
if (!dist)
OpenPOWER on IntegriCloud