aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-05 10:48:08 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-05 10:57:53 +0200
commit45a7b0674dba25295e439b50797e5231ad16b3b7 (patch)
tree2ec10212151e64642df03ac0fef4270f9abc07a2
parent3d42addf336739a69aee47891413a46e4f64995b (diff)
downloadffmpeg-45a7b0674dba25295e439b50797e5231ad16b3b7.tar.gz
oggvorbis: fix the first 2 packets timestamps matching issue
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/oggparsevorbis.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index fa03ed752e..28de6bd8e1 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -323,9 +323,9 @@ static int vorbis_packet(AVFormatContext *s, int idx)
}
next_pkt += os->segments[seg];
}
- os->lastpts = os->lastdts = os->granule - FFMIN(duration, os->granule);
+ os->lastpts = os->lastdts = os->granule - duration;
if(s->streams[idx]->start_time == AV_NOPTS_VALUE) {
- s->streams[idx]->start_time = os->lastpts;
+ s->streams[idx]->start_time = FFMAX(os->lastpts, 0);
if (s->streams[idx]->duration)
s->streams[idx]->duration -= s->streams[idx]->start_time;
}