]> git.sesse.net Git - vlc/commitdiff
* modules/codec/quicktime.c, modules/codec/cinepak.c: use pts if available, otherwise...
authorGildas Bazin <gbazin@videolan.org>
Sun, 23 Nov 2003 13:25:32 +0000 (13:25 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 23 Nov 2003 13:25:32 +0000 (13:25 +0000)
modules/codec/cinepak.c
modules/codec/quicktime.c

index f04f44bcd929d902debc8620bbde3f2af6e6d060..86be9174a66a44e0cb7f133a1358c35d251433b6 100644 (file)
@@ -2,7 +2,7 @@
  * cinepak.c: cinepak video decoder
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: cinepak.c,v 1.5 2003/11/23 05:30:56 fenrir Exp $
+ * $Id: cinepak.c,v 1.6 2003/11/23 13:25:32 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -184,7 +184,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             }
         }
 
-        p_pic->date = p_block->i_pts;
+        p_pic->date = p_block->i_pts ? p_block->i_pts : p_block->i_dts;
     }
 
     block_Release( p_block );
index 2327e3812f1e8bf8309d20edcd2bd04288ca8a9e..1ae9305f1e7f7c6e0bd8209b5a384c560a1686b9 100644 (file)
@@ -2,7 +2,7 @@
  * quicktime.c: a quicktime decoder that uses the QT library/dll
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: quicktime.c,v 1.17 2003/11/23 03:45:11 fenrir Exp $
+ * $Id: quicktime.c,v 1.18 2003/11/23 13:25:32 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir at via.ecp.fr>
  *          Derk-Jan Hartman <thedj at users.sf.net>
@@ -812,9 +812,10 @@ exit_error:
 static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
+    block_t       *p_block;
+    picture_t     *p_pic;
+    mtitme        i_pts;
 
-    block_t         *p_block;
-    picture_t       *p_pic;
     ComponentResult cres;
 
 #ifdef LOADER
@@ -839,7 +840,9 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
     p_block = *pp_block;
     *pp_block = NULL;
 
-    if( p_block->i_pts < mdate() )
+    i_pts = p_block->i_pts ? p_block->i_pts : p_block->i_dts;
+
+    if( i_pts < mdate() )
     {
         p_sys->i_late++;
     }
@@ -877,10 +880,9 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
                      (int)cres,(int)-cres, (int)cres );
         }
 
-        memcpy( p_pic->p[0].p_pixels,
-                p_sys->plane,
+        memcpy( p_pic->p[0].p_pixels, p_sys->plane,
                 p_dec->fmt_in.video.i_width * p_dec->fmt_in.video.i_height * 2 );
-        p_pic->date = p_block->i_pts;
+        p_pic->date = i_pts;
     }
     block_Release( p_block );