]> git.sesse.net Git - vlc/commitdiff
* modules/codec/ffmpeg/video.[ch]: another temporary workaround.
authorGildas Bazin <gbazin@videolan.org>
Tue, 12 Aug 2003 17:01:35 +0000 (17:01 +0000)
committerGildas Bazin <gbazin@videolan.org>
Tue, 12 Aug 2003 17:01:35 +0000 (17:01 +0000)
modules/codec/ffmpeg/video.c
modules/codec/ffmpeg/video.h

index afc9086f0da6d0169c618cd7e92c1c5b3b91cd5e..265b62236f68404d2714cf90811b2f99c465c720 100644 (file)
@@ -2,7 +2,7 @@
  * video.c: video decoder using ffmpeg library
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: video.c,v 1.38 2003/08/09 19:49:13 gbazin Exp $
+ * $Id: video.c,v 1.39 2003/08/12 17:01:35 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -380,6 +380,8 @@ int E_( InitThread_Video )( vdec_thread_t *p_vdec )
     p_vdec->input_pts_previous = 0;
     p_vdec->input_pts = 0;
 
+    p_vdec->b_has_b_frames = VLC_FALSE;
+
     return( VLC_SUCCESS );
 }
 
@@ -588,11 +590,14 @@ usenextdata:
     /* Set the PTS
      * There is an ugly hack here because some demuxers pass us a dts instead
      * of a pts so this screw up things for streams with B frames. */
+    if( p_vdec->p_ff_pic->pict_type == FF_B_TYPE )
+        p_vdec->b_has_b_frames = VLC_TRUE;
     if( p_vdec->p_ff_pic->pts &&
-        ( !p_vdec->p_context->has_b_frames ||
+        ( !p_vdec->p_context->has_b_frames || !p_vdec->b_has_b_frames ||
           p_vdec->p_ff_pic->pict_type == FF_B_TYPE ) )
     {
         p_vdec->pts = p_vdec->p_ff_pic->pts;
+msg_Err( p_vdec->p_fifo, "new pts: "I64Fd, p_vdec->pts );
     }
 
     if( p_vdec->pts <= 0 )
index cc17e9de853395e162b41e106a5a0c509b025fc2..8124682ae276c1273829ecd02bc1cada59c01304 100644 (file)
@@ -2,7 +2,7 @@
  * video.h: video decoder using ffmpeg library
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: video.h,v 1.10 2003/08/08 17:08:32 gbazin Exp $
+ * $Id: video.h,v 1.11 2003/08/12 17:01:35 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -40,6 +40,9 @@ typedef struct vdec_thread_s
     int b_hurry_up;
     int i_frame_error;
     int i_frame_skip;
+
+    vlc_bool_t b_has_b_frames;
+
     int     i_frame_late;   /* how many decoded frames are late */
     mtime_t i_frame_late_start;