From 4d636fa3a74924691b0bb1e26e600f7657e0af5c Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sun, 1 Aug 2010 13:51:50 +0300 Subject: [PATCH] Call libvlc_set_exit_handler() before the interfaces and playlist start --- bin/vlc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/vlc.c b/bin/vlc.c index 25fcf51644..7e775d384b 100644 --- a/bin/vlc.c +++ b/bin/vlc.c @@ -203,6 +203,8 @@ int main( int i_argc, const char *ppsz_argv[] ) if (vlc == NULL) goto out; + pthread_t self = pthread_self (); + libvlc_set_exit_handler (vlc, vlc_kill, &self); libvlc_set_user_agent (vlc, "VLC media player", NULL); #if !defined (HAVE_MAEMO) && !defined __APPLE__ @@ -213,10 +215,6 @@ int main( int i_argc, const char *ppsz_argv[] ) libvlc_playlist_play (vlc, -1, 0, NULL); - /* Wait for a termination signal */ - pthread_t self = pthread_self (); - libvlc_set_exit_handler (vlc, vlc_kill, &self); - if (signal_ignored (SIGHUP)) /* <- needed to handle nohup properly */ sigdelset (&set, SIGHUP); sigdelset (&set, SIGPIPE); -- 2.39.2