]> git.sesse.net Git - vlc/blobdiff - bin/darwinvlc.c
demux: ts: rewrite/split IOD parsing
[vlc] / bin / darwinvlc.c
index 19d2c58886ec479f2924c167a87b159efbd1f612..fbad4152865033eb2e649bbd69841b3c5f0245db 100644 (file)
@@ -55,6 +55,12 @@ static bool signal_ignored (int signum)
             ? (void *)sa.sa_sigaction : (void *)sa.sa_handler) == SIG_IGN;
 }
 
+static void vlc_kill (void *data)
+{
+    pthread_t *ps = data;
+    pthread_kill (*ps, SIGTERM);
+}
+
 static void exit_timeout (int signum)
 {
     (void) signum;
@@ -144,12 +150,11 @@ int main( int i_argc, const char *ppsz_argv[] )
     /* Block all these signals */
     pthread_sigmask (SIG_SETMASK, &set, NULL);
 
-    const char *argv[i_argc + 3];
+    const char *argv[i_argc + 2];
     int argc = 0;
 
     argv[argc++] = "--no-ignore-config";
     argv[argc++] = "--media-library";
-    argv[argc++] = "--stats";
 
     /* overwrite system language on Mac */
 #if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR // TARGET_OS_MAC is unspecific
@@ -204,12 +209,15 @@ int main( int i_argc, const char *ppsz_argv[] )
 
     vlc_enable_override ();
 
+    pthread_t self = pthread_self ();
+
     /* Initialize libvlc */
     libvlc_instance_t *vlc = libvlc_new (argc, argv);
     if (vlc == NULL)
         return 1;
 
     int ret = 1;
+    libvlc_set_exit_handler (vlc, vlc_kill, &self);
     libvlc_set_app_id (vlc, "org.VideoLAN.VLC", PACKAGE_VERSION, PACKAGE_NAME);
     libvlc_set_user_agent (vlc, "VLC media player", "VLC/"PACKAGE_VERSION);