diff options
author | David Conrad <lessen42@gmail.com> | 2009-12-12 20:18:43 +0000 |
---|---|---|
committer | David Conrad <lessen42@gmail.com> | 2009-12-12 20:18:43 +0000 |
commit | 5e15c7d95be456e9dafbcca7cb0d936cc331dbae (patch) | |
tree | 8643ef620e2b65b6a388d317fbce837beafde1e1 /libavformat/oggparsespeex.c | |
parent | 7a14430ed75a2eaaa430e46c2f54a7a9a8b71804 (diff) | |
download | ffmpeg-5e15c7d95be456e9dafbcca7cb0d936cc331dbae.tar.gz |
Fix PTS for OGM codecs.
Fixes issue251
Originally committed as revision 20815 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/oggparsespeex.c')
-rw-r--r-- | libavformat/oggparsespeex.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/oggparsespeex.c b/libavformat/oggparsespeex.c index f6174749f2..14d2b38131 100644 --- a/libavformat/oggparsespeex.c +++ b/libavformat/oggparsespeex.c @@ -95,15 +95,16 @@ static int speex_packet(AVFormatContext *s, int idx) os->private = spxp; } - if (os->flags & OGG_FLAG_EOS && os->lastgp != -1 && os->granule > 0) { + if (os->flags & OGG_FLAG_EOS && os->lastpts != AV_NOPTS_VALUE && + os->granule > 0) { /* first packet of final page. we have to calculate the final packet duration here because it is the only place we know the next-to-last granule position. */ - spxp->final_packet_duration = os->granule - os->lastgp - + spxp->final_packet_duration = os->granule - os->lastpts - packet_size * (ogg_page_packets(os) - 1); } - if (!os->lastgp && os->granule > 0) + if (!os->lastpts && os->granule > 0) /* first packet */ os->pduration = os->granule - packet_size * (ogg_page_packets(os) - 1); else if (os->flags & OGG_FLAG_EOS && os->segp == os->nsegs && |