X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=bin%2Fvlc.c;h=25fcf51644e4f4330b44740c08c08afb2518ff9a;hb=351d62a8500f37b5bb3683bb18abd85774184354;hp=7e775d384b3e5ebaaa0e3aaaf9a15bc337d5b8c2;hpb=dbb30dece5ad3cd149400b3ca9c2857c6eb7cc4d;p=vlc diff --git a/bin/vlc.c b/bin/vlc.c index 7e775d384b..25fcf51644 100644 --- a/bin/vlc.c +++ b/bin/vlc.c @@ -203,8 +203,6 @@ 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__ @@ -215,6 +213,10 @@ 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);