summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-11 18:03:45 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-11 18:12:14 +0200
commit27b8ef5bb7095e67d2888e0391b88dcffd04036a (patch)
treef3b2390468c2ff2032ba905b1693a8ed55527570 /libavformat
parent5c57e2b51bc0c1f91ddefc85ced4b4ba3a6d3c00 (diff)
avformat/oggparsevorbis: Dont attempt to calculate timestamps from gp=0
Fixes Ticket3710 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/oggparsevorbis.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index 51c5eb321f..8103d9dbb1 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -427,6 +427,10 @@ static int vorbis_packet(AVFormatContext *s, int idx)
}
os->lastpts =
os->lastdts = os->granule - duration;
+
+ if (!os->granule && duration) //hack to deal with broken files (Ticket3710)
+ os->lastpts = os->lastdts = AV_NOPTS_VALUE;
+
if (s->streams[idx]->start_time == AV_NOPTS_VALUE) {
s->streams[idx]->start_time = FFMAX(os->lastpts, 0);
if (s->streams[idx]->duration != AV_NOPTS_VALUE)