[vlc-devel] commit: Avoid using i_object_type ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Jan 17 20:31:39 CET 2009


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Jan 17 21:25:57 2009 +0200| [98eb1db33dd48d838d500ba8e954952e688b1a03] | committer: Rémi Denis-Courmont 

Avoid using i_object_type

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=98eb1db33dd48d838d500ba8e954952e688b1a03
---

 modules/codec/mpeg_audio.c |   22 ++++++++++++----------
 modules/gui/maemo/maemo.c  |    1 -
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/modules/codec/mpeg_audio.c b/modules/codec/mpeg_audio.c
index bb2493f..34d43a2 100644
--- a/modules/codec/mpeg_audio.c
+++ b/modules/codec/mpeg_audio.c
@@ -127,9 +127,9 @@ vlc_module_begin ()
 vlc_module_end ()
 
 /*****************************************************************************
- * OpenDecoder: probe the decoder and return score
+ * Open: probe the decoder and return score
  *****************************************************************************/
-static int OpenDecoder( vlc_object_t *p_this )
+static int Open( vlc_object_t *p_this )
 {
     decoder_t *p_dec = (decoder_t*)p_this;
     decoder_sys_t *p_sys;
@@ -139,13 +139,6 @@ static int OpenDecoder( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
-    /* HACK: Don't use this codec if we don't have an mpga audio filter */
-    if( p_dec->i_object_type == VLC_OBJECT_DECODER &&
-        !module_exists( "mpgatofixed32" ) )
-    {
-        return VLC_EGENERIC;
-    }
-
     /* Allocate the memory needed to store the decoder's structure */
     if( ( p_dec->p_sys = p_sys =
           (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
@@ -175,11 +168,20 @@ static int OpenDecoder( vlc_object_t *p_this )
     return VLC_SUCCESS;
 }
 
+static int OpenDecoder( vlc_object_t *p_this )
+{
+    /* HACK: Don't use this codec if we don't have an mpga audio filter */
+    if( !module_exists( "mpgatofixed32" ) )
+        return VLC_EGENERIC;
+
+    return Open( p_this );
+}
+
 static int OpenPacketizer( vlc_object_t *p_this )
 {
     decoder_t *p_dec = (decoder_t*)p_this;
 
-    int i_ret = OpenDecoder( p_this );
+    int i_ret = Open( p_this );
 
     if( i_ret == VLC_SUCCESS ) p_dec->p_sys->b_packetizer = true;
 
diff --git a/modules/gui/maemo/maemo.c b/modules/gui/maemo/maemo.c
index 0ee0c3e..8bdafdb 100644
--- a/modules/gui/maemo/maemo.c
+++ b/modules/gui/maemo/maemo.c
@@ -287,7 +287,6 @@ static int OpenWindow (vlc_object_t *obj)
         msg_Err( obj, "Maemo interface not found" );
         return VLC_EGENERIC; /* Maemo not in use */
     }
-    assert (intf->i_object_type == VLC_OBJECT_INTF);
 
     wnd->handle = request_video( intf, wnd->vout );
     msg_Dbg( intf, "Using handle %p", wnd->handle );




More information about the vlc-devel mailing list