- int i_signal, state;
- (void)sigwait (set, &i_signal);
-
- /* Once a signal has been trapped, the termination sequence will be
- * armed and subsequent signals will be ignored to avoid sending
- * signals to a libvlc structure having been destroyed */
-
- pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
- if( !b_die )
- {
- b_die = VLC_TRUE;
- abort_time = time( NULL );
-
- fprintf( stderr, "signal %d received, terminating vlc - do it "
- "again in case it gets stuck\n", i_signal );
-
- /* Acknowledge the signal received */
- VLC_Die( 0 );
- }
- else if( time( NULL ) > abort_time + 2 )
- {
- /* If user asks again 1 or 2 seconds later, die badly */
- pthread_sigmask (SIG_UNBLOCK, set, NULL);
- fprintf( stderr, "user insisted too much, dying badly\n" );
- abort();
- }
- pthread_setcancelstate (state, NULL);
+ libvlc_add_intf (vlc, "signals", &dummy);
+ libvlc_add_intf (vlc, NULL, &ex);
+ libvlc_playlist_play (vlc, -1, 0, NULL, &dummy);
+ libvlc_wait (vlc);
+ libvlc_release (vlc);