Commit 050ec31d authored by Gildas Bazin's avatar Gildas Bazin

* src/video_output/video_output.c, include/video_output.h:
   take into account the caching delay when dropping frames that are too
   far into the future.
parent b0bbf9c3
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* thread, and destroy a previously opened video output thread. * thread, and destroy a previously opened video output thread.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr> * Samuel Hocevar <sam@via.ecp.fr>
...@@ -114,6 +114,8 @@ struct vout_thread_t ...@@ -114,6 +114,8 @@ struct vout_thread_t
mtime_t display_jitter; /* average deviation from the PTS */ mtime_t display_jitter; /* average deviation from the PTS */
count_t c_jitter_samples; /* number of samples used for the * count_t c_jitter_samples; /* number of samples used for the *
* calculation of the jitter */ * calculation of the jitter */
/* delay created by internal caching */
int i_pts_delay;
/* Filter chain */ /* Filter chain */
char *psz_filter_chain; char *psz_filter_chain;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread. * thread, and destroy a previously oppened video output thread.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * 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> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "video.h" #include "video.h"
#include "video_output.h" #include "video_output.h"
#include <vlc/input.h> /* for input_thread_t and i_pts_delay */
#if defined( SYS_DARWIN ) #if defined( SYS_DARWIN )
#include "darwin_specific.h" #include "darwin_specific.h"
...@@ -180,6 +181,7 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, ...@@ -180,6 +181,7 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent,
vlc_fourcc_t i_chroma, unsigned int i_aspect ) vlc_fourcc_t i_chroma, unsigned int i_aspect )
{ {
vout_thread_t * p_vout; /* thread descriptor */ vout_thread_t * p_vout; /* thread descriptor */
input_thread_t * p_input_thread;
int i_index; /* loop variable */ int i_index; /* loop variable */
char * psz_plugin; char * psz_plugin;
vlc_value_t val; vlc_value_t val;
...@@ -357,6 +359,19 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, ...@@ -357,6 +359,19 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent,
return NULL; 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 */ /* Create thread and set locks */
vlc_mutex_init( p_vout, &p_vout->picture_lock ); vlc_mutex_init( p_vout, &p_vout->picture_lock );
vlc_mutex_init( p_vout, &p_vout->subpicture_lock ); vlc_mutex_init( p_vout, &p_vout->subpicture_lock );
...@@ -699,7 +714,7 @@ static void RunThread( vout_thread_t *p_vout) ...@@ -699,7 +714,7 @@ static void RunThread( vout_thread_t *p_vout)
continue; 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 */ /* Picture is waaay too early: it will be destroyed */
vlc_mutex_lock( &p_vout->picture_lock ); vlc_mutex_lock( &p_vout->picture_lock );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment