[vlc-devel] commit: gesture: remove one dummy function and clean a bit. ( Rémi Duraffort )
git version control
git at videolan.org
Fri Feb 27 19:24:47 CET 2009
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Feb 26 18:22:51 2009 +0100| [2f47743dcf44e953c7b82bfd9ffe3ffa3a6d5437] | committer: Rémi Duraffort
gesture: remove one dummy function and clean a bit.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2f47743dcf44e953c7b82bfd9ffe3ffa3a6d5437
---
modules/control/gestures.c | 39 +++++++++++----------------------------
1 files changed, 11 insertions(+), 28 deletions(-)
diff --git a/modules/control/gestures.c b/modules/control/gestures.c
index 3bb38a5..ce4135c 100644
--- a/modules/control/gestures.c
+++ b/modules/control/gestures.c
@@ -1,7 +1,7 @@
/*****************************************************************************
* gestures.c: control vlc with mouse gestures
*****************************************************************************
- * Copyright (C) 2004 the VideoLAN team
+ * Copyright (C) 2004-2009 the VideoLAN team
* $Id$
*
* Authors: Sigmund Augdal Helberg <dnumgis at videolan.org>
@@ -116,13 +116,11 @@ int Open ( vlc_object_t *p_this )
/* Allocate instance and initialize some members */
p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
- {
- return( 1 );
- };
+ return VLC_ENOMEM;
p_intf->pf_run = RunIntf;
- return( 0 );
+ return VLC_SUCCESS;
}
/*****************************************************************************
@@ -134,15 +132,6 @@ static int gesture( int i_pattern, int i_num )
}
/*****************************************************************************
- * input_from_playlist: don't forget to release the return value
- * Also this function should really be available from core.
- *****************************************************************************/
-static input_thread_t * input_from_playlist ( playlist_t *p_playlist )
-{
- return playlist_CurrentInput( p_playlist );
-}
-
-/*****************************************************************************
* CloseIntf: destroy dummy interface
*****************************************************************************/
void Close ( vlc_object_t *p_this )
@@ -220,9 +209,8 @@ static void RunIntf( intf_thread_t *p_intf )
{
input_thread_t * p_input;
p_playlist = pl_Hold( p_intf );
-
- p_input = input_from_playlist( p_playlist );
- vlc_object_release( p_playlist );
+ p_input = playlist_CurrentInput( p_playlist );
+ pl_Release( p_intf );
if( !p_input )
break;
@@ -247,15 +235,13 @@ static void RunIntf( intf_thread_t *p_intf )
break;
case GESTURE(LEFT,DOWN,NONE,NONE):
p_playlist = pl_Hold( p_intf );
-
playlist_Prev( p_playlist );
- vlc_object_release( p_playlist );
+ pl_Release( p_intf );
break;
case GESTURE(RIGHT,DOWN,NONE,NONE):
p_playlist = pl_Hold( p_intf );
-
playlist_Next( p_playlist );
- vlc_object_release( p_playlist );
+ pl_Release( p_intf );
break;
case UP:
{
@@ -286,10 +272,8 @@ static void RunIntf( intf_thread_t *p_intf )
int i_count, i;
p_playlist = pl_Hold( p_intf );
-
- p_input = input_from_playlist( p_playlist );
-
- vlc_object_release( p_playlist );
+ p_input = playlist_CurrentInput( p_playlist );
+ pl_Release( p_intf );
if( !p_input )
break;
@@ -341,9 +325,8 @@ static void RunIntf( intf_thread_t *p_intf )
int i_count, i;
p_playlist = pl_Hold( p_intf );
-
- p_input = input_from_playlist( p_playlist );
- vlc_object_release( p_playlist );
+ p_input = playlist_CurrentInput( p_playlist );
+ pl_Release( p_intf );
if( !p_input )
break;
More information about the vlc-devel
mailing list