Browse Source

oggdec:Correct duration

Based on a patch by Reimar Döffinger.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.8
jan gerber Michael Niedermayer 15 years ago
parent
commit
5901cd6236
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      libavformat/oggdec.c

+ 12
- 0
libavformat/oggdec.c View File

@@ -490,6 +490,18 @@ ogg_get_length (AVFormatContext * s)

ogg_restore (s, 0);

ogg_save (s);
url_fseek (s->pb, 0, SEEK_SET);
while (!ogg_read_page (s, &i)){
if (ogg->streams[i].granule != -1 && ogg->streams[i].granule != 0 &&
ogg->streams[i].codec) {
s->streams[i]->duration -=
ogg_gptopts (s, i, ogg->streams[i].granule, NULL);
break;
}
}
ogg_restore (s, 0);

return 0;
}



Loading…
Cancel
Save