[MPlayer-dev-eng] [BUG] [PATCH] Ogg/Theora frametime broken on 0-length packets

David Kuehling dvdkhlng at gmx.de
Sat Apr 30 14:34:20 CEST 2011


Hi,

I noticed that a/v sync drifts in theora files that contain 0-length
video demux packets (i.e. frames where the image doesn't change at all),
when played back with -demuxer ogg.  The libavformat demuxer seems to
work correctly.  However it uses so much memory (a leak), that it won't
work on the target platform (NanoNote: 32MB RAM, no swap).

Looking closer, I found that ds_get_next_pts() returns the *current* pts
when the packet read last has zero length.  This is due to the check
for 'ds->buffer_pos' to see whether data have already been read from the
*current* packet.  Of course, ds->buffer_pos will stay when a
zero-length packet was read, so that fails.

The atteched patch fixes that by skipping the frametime computation that
involves ds_get_next_pts(), thus just using the stream's frametime from
sh_video.  (Ogg/Theora is strictly constant-framerate, so there is no
reason to do the complex per-frame frametime computation anyway).

cheers,

David
-- 
GnuPG public key: http://user.cs.tu-berlin.de/~dvdkhlng/dk.gpg
Fingerprint: B17A DC95 D293 657B 4205  D016 7DEF 5323 C174 7D40

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 030-fix-theora-emtpy-packets.patch
Type: text/x-diff
Size: 837 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110430/fd1cf314/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110430/fd1cf314/attachment.asc>


More information about the MPlayer-dev-eng mailing list