Commit b173cc47 authored by David Fuhrmann's avatar David Fuhrmann

bin/darwinvlc: readd exit handler for the case the macosx interface is not used

parent c0ebd894
...@@ -55,6 +55,12 @@ static bool signal_ignored (int signum) ...@@ -55,6 +55,12 @@ static bool signal_ignored (int signum)
? (void *)sa.sa_sigaction : (void *)sa.sa_handler) == SIG_IGN; ? (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) static void exit_timeout (int signum)
{ {
(void) signum; (void) signum;
...@@ -204,12 +210,15 @@ int main( int i_argc, const char *ppsz_argv[] ) ...@@ -204,12 +210,15 @@ int main( int i_argc, const char *ppsz_argv[] )
vlc_enable_override (); vlc_enable_override ();
pthread_t self = pthread_self ();
/* Initialize libvlc */ /* Initialize libvlc */
libvlc_instance_t *vlc = libvlc_new (argc, argv); libvlc_instance_t *vlc = libvlc_new (argc, argv);
if (vlc == NULL) if (vlc == NULL)
return 1; return 1;
int ret = 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_app_id (vlc, "org.VideoLAN.VLC", PACKAGE_VERSION, PACKAGE_NAME);
libvlc_set_user_agent (vlc, "VLC media player", "VLC/"PACKAGE_VERSION); libvlc_set_user_agent (vlc, "VLC media player", "VLC/"PACKAGE_VERSION);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment