Commit 5901cd62 authored by jan gerber's avatar jan gerber Committed by Michael Niedermayer

oggdec:Correct duration

Based on a patch by Reimar Döffinger.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c8981edd
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment