]> git.sesse.net Git - vlc/commitdiff
omxil: Only use pts if it actually is set
authorMartin Storsjö <martin@martin.st>
Wed, 29 Aug 2012 21:44:42 +0000 (00:44 +0300)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 4 Sep 2012 10:03:47 +0000 (12:03 +0200)
If we need to use pts for timestamps, but pts isn't set (the
avi demuxer seems to set it to 0 for cases where it isn't known, while
dts has a nonzero value), use dts instead.

This fixes things on OMAP4 (the only platform where b_use_pts is
set at the moment), when playing back files that have only dts,
no pts.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/codec/omxil/omxil.c

index 3e44fb23cf638beeb7ab22d2b716f34e3f0477e0..0e54611b22c2b61ed718ab66f25d9fc2164117ec 100644 (file)
@@ -1313,7 +1313,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
         p_header->nFilledLen = p_block->i_buffer;
         p_header->nOffset = 0;
         p_header->nFlags = OMX_BUFFERFLAG_ENDOFFRAME;
-        if (p_sys->b_use_pts)
+        if (p_sys->b_use_pts && p_block->i_pts)
             p_header->nTimeStamp = p_block->i_pts;
         else
             p_header->nTimeStamp = p_block->i_dts;