Commit a274331e authored by Laurent Aimar's avatar Laurent Aimar

Split vout_FixLeaks into vout_FixLeaks and vout_Reset.

No functionnal changes.
parent fd32a7c3
...@@ -2068,9 +2068,7 @@ static void DeleteDecoder( decoder_t * p_dec ) ...@@ -2068,9 +2068,7 @@ static void DeleteDecoder( decoder_t * p_dec )
{ {
/* Hack to make sure all the the pictures are freed by the decoder /* Hack to make sure all the the pictures are freed by the decoder
* and that the vout is not paused anymore */ * and that the vout is not paused anymore */
vout_FixLeaks( p_owner->p_vout, true ); vout_Reset( p_owner->p_vout );
if( p_owner->b_paused )
vout_ChangePause( p_owner->p_vout, false, mdate() );
/* */ /* */
input_resource_RequestVout( p_owner->p_input->p->p_resource, p_owner->p_vout, NULL, true ); input_resource_RequestVout( p_owner->p_input->p->p_resource, p_owner->p_vout, NULL, true );
...@@ -2379,7 +2377,7 @@ static picture_t *vout_new_buffer( decoder_t *p_dec ) ...@@ -2379,7 +2377,7 @@ static picture_t *vout_new_buffer( decoder_t *p_dec )
DecoderSignalBuffering( p_dec, true ); DecoderSignalBuffering( p_dec, true );
/* Check the decoder doesn't leak pictures */ /* Check the decoder doesn't leak pictures */
vout_FixLeaks( p_owner->p_vout, false ); vout_FixLeaks( p_owner->p_vout );
/* FIXME add a vout_WaitPictureAvailable (timedwait) */ /* FIXME add a vout_WaitPictureAvailable (timedwait) */
msleep( VOUT_OUTMEM_SLEEP ); msleep( VOUT_OUTMEM_SLEEP );
......
...@@ -592,25 +592,22 @@ void vout_Flush(vout_thread_t *vout, mtime_t date) ...@@ -592,25 +592,22 @@ void vout_Flush(vout_thread_t *vout, mtime_t date)
vlc_mutex_unlock(&vout->p->picture_lock); vlc_mutex_unlock(&vout->p->picture_lock);
} }
static void vout_Reset(vout_thread_t *vout) void vout_Reset(vout_thread_t *vout)
{ {
#warning "TODO reset pause in vout_Reset"
vlc_mutex_lock(&vout->p->picture_lock); vlc_mutex_lock(&vout->p->picture_lock);
Flush(vout, INT64_MAX, true); Flush(vout, INT64_MAX, true);
if (vout->p->decoder_pool) if (vout->p->decoder_pool)
picture_pool_NonEmpty(vout->p->decoder_pool, true); picture_pool_NonEmpty(vout->p->decoder_pool, true);
vout->p->pause.is_on = false;
vout->p->pause.date = mdate();
vlc_cond_signal( &vout->p->picture_wait ); vlc_cond_signal( &vout->p->picture_wait );
vlc_mutex_unlock(&vout->p->picture_lock); vlc_mutex_unlock(&vout->p->picture_lock);
} }
void vout_FixLeaks( vout_thread_t *vout, bool b_forced ) void vout_FixLeaks( vout_thread_t *vout )
{ {
#warning "TODO split vout_FixLeaks into vout_FixLeaks and vout_Reset"
if (b_forced) {
vout_Reset(vout);
return;
}
vlc_mutex_lock(&vout->p->picture_lock); vlc_mutex_lock(&vout->p->picture_lock);
picture_t *picture = picture_fifo_Peek(vout->p->decoder_fifo); picture_t *picture = picture_fifo_Peek(vout->p->decoder_fifo);
......
...@@ -61,7 +61,12 @@ void vout_Flush( vout_thread_t *p_vout, mtime_t i_date ); ...@@ -61,7 +61,12 @@ void vout_Flush( vout_thread_t *p_vout, mtime_t i_date );
* *
* XXX This function is there to workaround bugs in decoder * XXX This function is there to workaround bugs in decoder
*/ */
void vout_FixLeaks( vout_thread_t *p_vout, bool b_forced ); void vout_FixLeaks( vout_thread_t *p_vout );
/*
* Reset the states of the vout.
*/
void vout_Reset( vout_thread_t *p_vout );
/** /**
* This functions will drop a picture retreived by vout_CreatePicture. * This functions will drop a picture retreived by vout_CreatePicture.
......
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