* thread, and destroy a previously opened video output thread.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_output.h,v 1.92 2003/01/28 22:03:21 sam Exp $
+ * $Id: video_output.h,v 1.93 2003/03/24 23:50:46 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
mtime_t display_jitter; /* average deviation from the PTS */
count_t c_jitter_samples; /* number of samples used for the *
* calculation of the jitter */
+ /* delay created by internal caching */
+ int i_pts_delay;
/* Filter chain */
char *psz_filter_chain;
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: video_output.c,v 1.213 2003/02/26 18:15:33 massiot Exp $
+ * $Id: video_output.c,v 1.214 2003/03/24 23:50:46 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
#include "video.h"
#include "video_output.h"
+#include <vlc/input.h> /* for input_thread_t and i_pts_delay */
#if defined( SYS_DARWIN )
#include "darwin_specific.h"
unsigned int i_width, unsigned int i_height,
vlc_fourcc_t i_chroma, unsigned int i_aspect )
{
- vout_thread_t * p_vout; /* thread descriptor */
- int i_index; /* loop variable */
- char * psz_plugin;
- vlc_value_t val;
+ vout_thread_t * p_vout; /* thread descriptor */
+ input_thread_t * p_input_thread;
+ int i_index; /* loop variable */
+ char * psz_plugin;
+ vlc_value_t val;
/* Allocate descriptor */
p_vout = vlc_object_create( p_parent, VLC_OBJECT_VOUT );
return NULL;
}
+ /* Calculate delay created by internal caching */
+ p_input_thread = (input_thread_t *)vlc_object_find( p_vout,
+ VLC_OBJECT_INPUT, FIND_PARENT );
+ if( p_input_thread )
+ {
+ p_vout->i_pts_delay = p_input_thread->i_pts_delay + VOUT_BOGUS_DELAY;
+ vlc_object_release( p_input_thread );
+ }
+ else
+ {
+ p_vout->i_pts_delay = VOUT_BOGUS_DELAY;
+ }
+
/* Create thread and set locks */
vlc_mutex_init( p_vout, &p_vout->picture_lock );
vlc_mutex_init( p_vout, &p_vout->subpicture_lock );
continue;
}
- if( display_date > current_date + VOUT_BOGUS_DELAY )
+ if( display_date > current_date + p_vout->i_pts_delay )
{
/* Picture is waaay too early: it will be destroyed */
vlc_mutex_lock( &p_vout->picture_lock );