1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

avformat/oggparsevorbis: Dont attempt to calculate timestamps from gp=0

Fixes Ticket3710

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2014-06-11 18:03:45 +02:00
parent 5c57e2b51b
commit 27b8ef5bb7

View File

@@ -427,6 +427,10 @@ static int vorbis_packet(AVFormatContext *s, int idx)
} }
os->lastpts = os->lastpts =
os->lastdts = os->granule - duration; 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) { if (s->streams[idx]->start_time == AV_NOPTS_VALUE) {
s->streams[idx]->start_time = FFMAX(os->lastpts, 0); s->streams[idx]->start_time = FFMAX(os->lastpts, 0);
if (s->streams[idx]->duration != AV_NOPTS_VALUE) if (s->streams[idx]->duration != AV_NOPTS_VALUE)