Changeset 7fd923e41a2a29be113391490731b1c82f726185

Show
Ignore:
Timestamp:
05/03/08 16:46:03 (4 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1209825963 +0300
git-parent:

[b89d540af12211361bfaa82a200872b3ba4f0eb0]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1209825963 +0300
Message:

No need to kill VLC if it's exiting already.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/vlc.c

    r449fd28 r7fd923e  
    5353extern void __wgetmainargs(int *argc, wchar_t ***wargv, wchar_t ***wenviron, 
    5454                           int expand_wildcards, int *startupinfo); 
    55 static inline void Kill(void) { } 
    5655#else 
    5756 
     
    6059# include <pthread.h> 
    6160 
    62 static void Kill (void); 
    6361static void *SigHandler (void *set); 
    6462#endif 
     
    6967int main( int i_argc, const char *ppsz_argv[] ) 
    7068{ 
    71     int i_ret
     69    int i_ret, id
    7270 
    7371#   ifdef __GLIBC__ 
     
    110108 
    111109    /* Create a libvlc structure */ 
    112     i_ret = VLC_Create(); 
    113     if( i_ret < 0 ) 
    114     { 
    115         return -i_ret; 
    116     } 
     110    id = VLC_Create(); 
     111    if( id < 0 ) 
     112        return 1; 
    117113 
    118114#if !defined(WIN32) && !defined(UNDER_CE) 
     
    209205 
    210206    /* Initialize libvlc */ 
    211     i_ret = VLC_Init( 0, i_argc, ppsz_argv ); 
     207    i_ret = VLC_Init( id, i_argc, ppsz_argv ); 
    212208    if( i_ret < 0 ) 
    213209    { 
     
    220216    /* Finish the threads */ 
    221217    VLC_CleanUp( 0 ); 
    222  
    223     Kill (); 
    224218 
    225219    /* Destroy the libvlc structure */ 
     
    285279            fprintf (stderr, "signal %d received, terminating vlc - do it " 
    286280                            "again quickly in case it gets stuck\n", i_signal); 
    287  
    288             /* Acknowledge the signal received */ 
    289             Kill (); 
     281            VLC_Die( 0 ); 
    290282        } 
    291283        else /* time (NULL) <= abort_time */ 
     
    309301    /* Never reached */ 
    310302} 
    311  
    312  
    313 static void KillOnce (void) 
    314 { 
    315     VLC_Die (0); 
    316 } 
    317  
    318 static void Kill (void) 
    319 { 
    320     static pthread_once_t once = PTHREAD_ONCE_INIT; 
    321     pthread_once (&once, KillOnce); 
    322 } 
    323  
    324303#endif 
    325304