[vlc-commits] commit: Split vout_FixLeaks into vout_FixLeaks and vout_Reset. ( Laurent Aimar )
git at videolan.org
git at videolan.org
Sat Apr 24 00:01:42 CEST 2010
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Apr 23 22:46:48 2010 +0200| [a274331ee5b95d7e2537255344d5b4d2991a41a3] | committer: Laurent Aimar
Split vout_FixLeaks into vout_FixLeaks and vout_Reset.
No functionnal changes.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a274331ee5b95d7e2537255344d5b4d2991a41a3
---
src/input/decoder.c | 6 ++----
src/video_output/video_output.c | 15 ++++++---------
src/video_output/vout_control.h | 7 ++++++-
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index a9594f1..5cf35bb 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -2068,9 +2068,7 @@ static void DeleteDecoder( decoder_t * p_dec )
{
/* Hack to make sure all the the pictures are freed by the decoder
* and that the vout is not paused anymore */
- vout_FixLeaks( p_owner->p_vout, true );
- if( p_owner->b_paused )
- vout_ChangePause( p_owner->p_vout, false, mdate() );
+ vout_Reset( p_owner->p_vout );
/* */
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 )
DecoderSignalBuffering( p_dec, true );
/* 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) */
msleep( VOUT_OUTMEM_SLEEP );
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index a5e7d00..30010e7 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -592,25 +592,22 @@ void vout_Flush(vout_thread_t *vout, mtime_t date)
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);
+
Flush(vout, INT64_MAX, true);
if (vout->p->decoder_pool)
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_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);
picture_t *picture = picture_fifo_Peek(vout->p->decoder_fifo);
diff --git a/src/video_output/vout_control.h b/src/video_output/vout_control.h
index d44b06d..ff2c622 100644
--- a/src/video_output/vout_control.h
+++ b/src/video_output/vout_control.h
@@ -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
*/
-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.
More information about the vlc-commits
mailing list