[vlc-devel] commit: Fixed inhibit playlist leak. (Laurent Aimar )
git version control
git at videolan.org
Thu Mar 5 23:26:05 CET 2009
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu Mar 5 23:25:30 2009 +0100| [8659d507094a91fe90e394f9578dfd214071073d] | committer: Laurent Aimar
Fixed inhibit playlist leak.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8659d507094a91fe90e394f9578dfd214071073d
---
modules/misc/inhibit.c | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/modules/misc/inhibit.c b/modules/misc/inhibit.c
index b6a8151..5e880bd 100644
--- a/modules/misc/inhibit.c
+++ b/modules/misc/inhibit.c
@@ -224,18 +224,30 @@ static int UnInhibit( intf_thread_t *p_intf )
/*****************************************************************************
* Run: main thread
*****************************************************************************/
+static void vlc_cleanup_playlist( void *p_playlist )
+{
+ pl_Release( (playlist_t*)p_playlist );
+}
static void Run( intf_thread_t *p_intf )
{
+ int canc = vlc_savecancel();
playlist_t *p_playlist = pl_Hold( p_intf );
- input_thread_t *p_input;
+
+ vlc_cleanup_push( vlc_cleanup_playlist, p_intf );
for( ;; )
{
- /* Check playing state every 30 seconds */
+ vlc_restorecancel( canc );
+
+ /* FIXME wake up on playlist event instead ?
+ * Check playing state every 30 seconds */
msleep( 30 * CLOCK_FREQ );
- p_input = playlist_CurrentInput( p_playlist );
+ canc = vlc_savecancel();
+
+ /* */
+ input_thread_t *p_input = playlist_CurrentInput( p_playlist );
if( p_input )
{
const int i_state = var_GetInteger( p_input, "state" );
@@ -262,5 +274,7 @@ static void Run( intf_thread_t *p_intf )
}
}
- pl_Release( p_intf );
+ /* */
+ vlc_cleanup_run();
+ vlc_restorecancel( canc );
}
More information about the vlc-devel
mailing list