p_vout->p_window = NULL;
p_vout->p->i_par_num =
p_vout->p->i_par_den = 1;
+ p_vout->p->p_picture_displayed = NULL;
/* Initialize locks */
vlc_mutex_init_recursive( &p_vout->picture_lock );
if( p_vout->pf_init( p_vout ) )
return VLC_EGENERIC;
+ p_vout->p->p_picture_displayed = NULL;
+
if( !I_OUTPUTPICTURES )
{
msg_Err( p_vout, "plugin was unable to allocate at least "
vout_thread_t *p_vout = (vout_thread_t *)p_this;
int i_idle_loops = 0; /* loops without displaying a picture */
- picture_t * p_last_picture = NULL; /* last picture */
-
subpicture_t * p_subpic = NULL; /* subpicture pointer */
bool b_drop_late;
display_date = p_picture->date;
}
}
- if( p_vout->p->b_paused && p_last_picture != NULL )
+ if( p_vout->p->b_paused && p_vout->p->p_picture_displayed != NULL )
{
p_picture = NULL;
- if( p_last_picture->date == 1 )
+ if( p_vout->p->p_picture_displayed->date == 1 )
{
for( i_index = 0; i_index < I_RENDERPICTURES; i_index++ )
{
if( p_pic->i_status != READY_PICTURE )
continue;
- if( p_pic->date <= p_last_picture->date && p_pic != p_last_picture )
+ if( p_pic->date <= p_vout->p->p_picture_displayed->date && p_pic != p_vout->p->p_picture_displayed )
{
DropPicture( p_vout, p_pic );
}
- else if( p_pic->date > p_last_picture->date && ( p_picture == NULL || p_pic->date < display_date ) )
+ else if( p_pic->date > p_vout->p->p_picture_displayed->date && ( p_picture == NULL || p_pic->date < display_date ) )
{
p_picture = p_pic;
display_date = p_picture->date;
}
}
if( !p_picture )
- p_picture = p_last_picture;
+ p_picture = p_vout->p->p_picture_displayed;
}
if( p_picture )
{
/* If we met the last picture, parse again to see whether there is
* a more appropriate one. */
- if( p_picture == p_last_picture && !p_vout->p->b_paused )
+ if( p_picture == p_vout->p->p_picture_displayed && !p_vout->p->b_paused )
{
for( i_index = 0; i_index < I_RENDERPICTURES; i_index++ )
{
picture_t *p_pic = PP_RENDERPICTURE[i_index];
if( p_pic->i_status == READY_PICTURE &&
- p_pic != p_last_picture &&
- ( p_picture == p_last_picture || p_pic->date < display_date ) )
+ p_pic != p_vout->p->p_picture_displayed &&
+ ( p_picture == p_vout->p->p_picture_displayed || p_pic->date < display_date ) )
{
p_picture = p_pic;
display_date = p_picture->date;
}
/* If we found better than the last picture, destroy it */
- if( p_last_picture && p_picture != p_last_picture )
+ if( p_vout->p->p_picture_displayed && p_picture != p_vout->p->p_picture_displayed )
{
- DropPicture( p_vout, p_last_picture );
- p_last_picture = NULL;
+ DropPicture( p_vout, p_vout->p->p_picture_displayed );
+ p_vout->p->p_picture_displayed = NULL;
}
/* Compute FPS rate */
= display_date;
if( !p_picture->b_force &&
- p_picture != p_last_picture &&
+ p_picture != p_vout->p->p_picture_displayed &&
display_date < current_date + p_vout->p->render_time &&
b_drop_late )
{
p_picture = NULL;
display_date = 0;
}
- else if( p_picture == p_last_picture )
+ else if( p_picture == p_vout->p->p_picture_displayed )
{
/* We are asked to repeat the previous picture, but we first
* wait for a couple of idle loops */
}
}
}
+ if( p_picture )
+ p_vout->p->p_picture_displayed = p_picture;
vlc_mutex_unlock( &p_vout->picture_lock );
if( p_picture == NULL )
/* Tell the vout this was the last picture and that it does not
* need to be forced anymore. */
- p_last_picture = p_picture;
- p_last_picture->b_force = false;
+ p_picture->b_force = false;
}
/* Drop the filtered picture if created by video filters */
p_vout->pf_end( p_vout );
+ p_vout->p->p_picture_displayed = NULL;
for( i = 0; i < I_OUTPUTPICTURES; i++ )
p_vout->p_picture[ i ].i_status = FREE_PICTURE;
struct vout_thread_sys_t
{
/* */
- vlc_mutex_t vfilter_lock; /**< video filter2 change lock */
+ picture_t *p_picture_displayed;
/* */
- uint32_t render_time; /**< last picture render time */
- unsigned int i_par_num; /**< monitor pixel aspect-ratio */
- unsigned int i_par_den; /**< monitor pixel aspect-ratio */
+ vlc_mutex_t vfilter_lock; /**< video filter2 change lock */
/* */
- bool b_direct; /**< rendered are like direct ? */
- filter_t *p_chroma;
+ uint32_t render_time; /**< last picture render time */
+ unsigned int i_par_num; /**< monitor pixel aspect-ratio */
+ unsigned int i_par_den; /**< monitor pixel aspect-ratio */
+
+ /* */
+ bool b_direct; /**< rendered are like direct ? */
+ filter_t *p_chroma;
/**
* These numbers are not supposed to be accurate, but are a
* good indication of the thread status */
- count_t c_fps_samples; /**< picture counts */
- mtime_t p_fps_sample[VOUT_FPS_SAMPLES]; /**< FPS samples dates */
+ count_t c_fps_samples; /**< picture counts */
+ mtime_t p_fps_sample[VOUT_FPS_SAMPLES]; /**< FPS samples dates */
/* Statistics */
int i_picture_lost;