]> git.sesse.net Git - vlc/commitdiff
Don't print debug messages and don't do interaction on preparsing
authorClément Stenac <zorglub@videolan.org>
Fri, 27 Jan 2006 20:35:42 +0000 (20:35 +0000)
committerClément Stenac <zorglub@videolan.org>
Fri, 27 Jan 2006 20:35:42 +0000 (20:35 +0000)
include/vlc_common.h
include/vlc_objects.h
src/input/input.c
src/interface/interaction.c
src/misc/messages.c
src/misc/modules.c
src/misc/objects.c

index c6998632c20ee5ccebe38ac75998d8af234c554e..77ba6b7ea37970a0b0e3def43d0ad9eb48f8e55f 100644 (file)
@@ -474,6 +474,7 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *,      /* variable's object */
                                                                             \
     /* Messages header */                                                   \
     char *psz_header;                                                       \
+    int  i_flags;                                                           \
                                                                             \
     /* Thread properties, if any */                                         \
     vlc_bool_t   b_thread;                                                  \
index 37930ec3237f4ee44247405437626f7c6a8ed38c..79b8f63f33e21e416fff94c38cf7302f20ccfee8 100644 (file)
 
 #define FIND_STRICT         0x0010
 
+/* Object flags */
+#define OBJECT_FLAGS_NODBG       0x0001
+#define OBJECT_FLAGS_QUIET       0x0002
+#define OBJECT_FLAGS_NOINTERACT  0x0004
+
 /*****************************************************************************
  * The vlc_object_t type. Yes, it's that simple :-)
  *****************************************************************************/
index 2fb71a39b6ad41344b26e90799c904f39bc473b2..ff78ae25c4cb0ac8a35fa172cc4549cd9fa2597d 100644 (file)
@@ -320,6 +320,8 @@ int __input_Preparse( vlc_object_t *p_parent, input_item_t *p_item )
 
     /* Allocate descriptor */
     p_input = Create( p_parent, p_item, NULL, VLC_TRUE );
+    p_input->i_flags |= OBJECT_FLAGS_NODBG;
+    p_input->i_flags |= OBJECT_FLAGS_NOINTERACT;
 
     /* Now we can attach our new input */
     vlc_object_attach( p_input, p_parent );
index 8e0c97a9db8f9c061e4519bfb544539c40d6dd50..90c4dcf9d4f236c47dfebcc6f475b8e5652feb74 100644 (file)
@@ -73,6 +73,11 @@ int  __intf_Interact( vlc_object_t *p_this, interaction_dialog_t *
         p_dialog->i_id = ++p_interaction->i_last_id;
     }
 
+    if( p_this->i_flags & OBJECT_FLAGS_NOINTERACT )
+    {
+       return;
+    }
+
     p_dialog->p_interaction = p_interaction;
     p_dialog->p_parent = p_this;
 
@@ -165,7 +170,6 @@ void intf_InteractionManage( playlist_t *p_playlist )
         {
         case ANSWERED_DIALOG:
             // Ask interface to hide it
-            msg_Dbg( p_interaction, "Hiding dialog %i", p_dialog->i_id );
             p_dialog->i_action = INTERACT_HIDE;
             val.p_address = p_dialog;
             if( p_interaction->p_intf )
@@ -178,15 +182,11 @@ void intf_InteractionManage( playlist_t *p_playlist )
             if( p_interaction->p_intf )
                 var_Set( p_interaction->p_intf, "interaction", val );
             p_dialog->i_status = SENT_DIALOG;
-            msg_Dbg( p_interaction, "Updating dialog %i, %i widgets",
-                                    p_dialog->i_id, p_dialog->i_widgets );
             break;
         case HIDDEN_DIALOG:
             if( !(p_dialog->i_flags & DIALOG_GOT_ANSWER) ) break;
             if( !(p_dialog->i_flags & DIALOG_REUSABLE) )
             {
-                msg_Dbg( p_interaction, "Destroying dialog %i",
-                                        p_dialog->i_id );
                 p_dialog->i_action = INTERACT_DESTROY;
                 val.p_address = p_dialog;
                 if( p_interaction->p_intf )
@@ -194,8 +194,6 @@ void intf_InteractionManage( playlist_t *p_playlist )
             }
             break;
         case DESTROYED_DIALOG:
-            msg_Dbg( p_interaction, "Removing dialog %i",
-                                    p_dialog->i_id );
             // Interface has now destroyed it, remove it
             REMOVE_ELEM( p_interaction->pp_dialogs, p_interaction->i_dialogs,
                          i_index);
index 740ec130fb281810b860479aba39927e21faa30a..e9e3bba10b6bd56e20dc06a7b9e1c93339a59d24 100644 (file)
@@ -307,6 +307,13 @@ static void QueueMsg( vlc_object_t *p_this, int i_queue_id, int i_type,
 #endif
     int i;
 
+    if( p_this->i_flags & OBJECT_FLAGS_QUIET ||
+        (p_this->i_flags & OBJECT_FLAGS_NODBG &&
+         i_type == VLC_MSG_DBG ) )
+    {
+        return;
+    }
+
     /*
      * Convert message to string
      */
index 678b1cf211c9492618a8f2b8c091eb71bceefe11..977466c2d9f4f613e04ecbd21e501f1a4db0a27a 100644 (file)
@@ -678,7 +678,7 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
 
     if( p_module != NULL )
     {
-        msg_Dbg( p_module, "using %s module \"%s\"",
+        msg_Dbg( p_this, "using %s module \"%s\"",
                  psz_capability, p_module->psz_object_name );
     }
     else if( p_first == NULL )
@@ -728,7 +728,7 @@ void __module_Unneed( vlc_object_t * p_this, module_t * p_module )
         p_module->pf_deactivate( p_this );
     }
 
-    msg_Dbg( p_module, "removing module \"%s\"", p_module->psz_object_name );
+    msg_Dbg( p_this, "removing module \"%s\"", p_module->psz_object_name );
 
     vlc_object_release( p_module );
 
index a1fd3e11203ed52e66e538154c88ab9d8163cde8..645373344e6fb656479c86945975c3f638bc7901 100644 (file)
@@ -250,6 +250,14 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type )
 
     p_new->psz_header = NULL;
 
+    p_new->i_flags = 0;
+    if( p_this->i_flags & OBJECT_FLAGS_NODBG )
+        p_new->i_flags |= OBJECT_FLAGS_NODBG;
+    if( p_this->i_flags & OBJECT_FLAGS_QUIET )
+        p_new->i_flags |= OBJECT_FLAGS_QUIET;
+    if( p_this->i_flags & OBJECT_FLAGS_NOINTERACT )
+        p_new->i_flags |= OBJECT_FLAGS_NOINTERACT;
+
     p_new->i_vars = 0;
     p_new->p_vars = (variable_t *)malloc( 16 * sizeof( variable_t ) );