]> git.sesse.net Git - vlc/blobdiff - src/libvlc-common.c
Updates and spelling improvements
[vlc] / src / libvlc-common.c
index 11429446b927936a34f3b79ce28963bd466efcb9..3f7a9d124c3e34c8f46d16cfc7129521354673ce 100644 (file)
@@ -42,6 +42,7 @@
 
 #include "modules/modules.h"
 #include "config/configuration.h"
+#include "interface/interface.h"
 
 #include <errno.h>                                                 /* ENOMEM */
 #include <stdio.h>                                              /* sprintf() */
@@ -192,6 +193,7 @@ libvlc_int_t * libvlc_InternalCreate( void )
         return NULL;
     }
     p_libvlc->p_playlist = NULL;
+    p_libvlc->p_interaction = NULL;
     p_libvlc->psz_object_name = "libvlc";
 
     /* Initialize message queue */
@@ -420,7 +422,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
         config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, VLC_TRUE );
         libvlc_global.p_module_bank->b_cache_delete = b_cache_delete;
     }
-    if( psz_language ) free( psz_language );
+    free( psz_language );
 # endif
 #endif
 
@@ -732,6 +734,9 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     /* Do a copy (we don't need to modify the strings) */
     memcpy( p_libvlc->p_hotkeys, libvlc_hotkeys, libvlc_hotkeys_size );
 
+    /* Initialize interaction */
+    p_libvlc->p_interaction = interaction_Init( p_libvlc );
+
     /* Initialize playlist and get commandline files */
     playlist_ThreadCreate( p_libvlc );
     if( !p_libvlc->p_playlist )
@@ -752,7 +757,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
         /* Add service discovery modules */
         playlist_ServicesDiscoveryAdd( p_playlist, psz_modules );
     }
-    if( psz_modules ) free( psz_modules );
+    free( psz_modules );
 
     /*
      * Load background interfaces
@@ -856,12 +861,12 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
             if( psz_morecodecs )
             {
                 config_PutPsz( p_libvlc, "codec", psz_morecodecs);
-                free(psz_morecodecs);
+                free( psz_morecodecs );
             }
         }
         else
             config_PutPsz( p_libvlc, "codec", "dmo,quicktime");
-        free(psz_codecs);
+        free( psz_codecs );
     }
 #endif
 
@@ -896,7 +901,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
         VLC_AddTarget( p_libvlc->i_object_id, val.psz_string, NULL, 0,
                        PLAYLIST_INSERT, 0 );
     }
-    if ( val.psz_string != NULL ) free( val.psz_string );
+    free( val.psz_string );
 
     return VLC_SUCCESS;
 }
@@ -945,6 +950,10 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
         aout_Delete( p_aout );
     }
 
+    /* Free interaction */
+    msg_Dbg( p_libvlc, "removing interaction" );
+    vlc_object_release( p_libvlc->p_interaction );
+
     stats_TimersDumpAll( p_libvlc );
     stats_TimersClean( p_libvlc );
 
@@ -991,7 +1000,7 @@ int libvlc_InternalDestroy( libvlc_int_t *p_libvlc, vlc_bool_t b_release )
                         psz_pidfile );
             }
         }
-        free ( psz_pidfile );
+        free( psz_pidfile );
     }
 #endif
 
@@ -1072,7 +1081,7 @@ int libvlc_InternalAddIntf( libvlc_int_t *p_libvlc,
          * We prefer the dummy interface if none is specified. */
         char *psz_interface = config_GetPsz( p_libvlc, "intf" );
         if( !psz_interface || !*psz_interface ) psz_module = "dummy";
-        if( psz_interface ) free( psz_interface );
+        free( psz_interface );
     }
 #endif