summaryrefslogtreecommitdiff
path: root/libavformat/oggdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/oggdec.c')
-rw-r--r--libavformat/oggdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index b2d734aeaa..0a4650158d 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -525,7 +525,9 @@ static int ogg_get_length(AVFormatContext *s)
ogg_save (s);
avio_seek (s->pb, s->data_offset, SEEK_SET);
ogg_reset(s);
+ i = -1;
while (!ogg_packet(s, &i, NULL, NULL, NULL)) {
+ if(i>=0) {
int64_t pts = ogg_calc_pts(s, i, NULL);
if (pts != AV_NOPTS_VALUE && s->streams[i]->start_time == AV_NOPTS_VALUE && !ogg->streams[i].got_start){
s->streams[i]->duration -= pts;
@@ -535,6 +537,7 @@ static int ogg_get_length(AVFormatContext *s)
ogg->streams[i].got_start= 1;
streams_left--;
}
+ }
if(streams_left<=0)
break;
}