Changeset ef066dadd58ccecc690eddedafce4ae4bb1f724a

Show
Ignore:
Timestamp:
03/03/07 17:32:09 (2 years ago)
Author:
Derk-Jan Hartman <hartman@videolan.org>
git-committer:
Derk-Jan Hartman <hartman@videolan.org> 1172939529 +0000
git-parent:

[d38407e052d6db044ff587ed3d9cc9e802ae27cc]

git-author:
Derk-Jan Hartman <hartman@videolan.org> 1172939529 +0000
Message:

* Fix blocking intf launching without pf_run on OSX

Files:

Legend:

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

    rd38407e ref066da  
    155155    NSAutoreleasePool * o_pool; 
    156156 
    157     if( p_intf->b_block ) 
    158     { 
    159         /* This is the primary intf */ 
    160         /* Run a manager thread, launch the interface, kill the manager */ 
    161         if( vlc_thread_create( p_intf, "manage", Manager, 
    162                                VLC_THREAD_PRIORITY_LOW, VLC_FALSE ) ) 
    163         { 
    164             msg_Err( p_intf, "cannot spawn manager thread" ); 
    165             return VLC_EGENERIC; 
    166         } 
    167     } 
    168  
     157    /* If !clivlc, then run as a OS X application */ 
    169158    if( p_intf->b_block && strncmp( p_intf->p_libvlc->psz_object_name, 
    170159                                    "clivlc", 6) ) 
     
    173162        [VLCApplication sharedApplication]; 
    174163        [NSApp setVLC: p_intf->p_libvlc]; 
    175     } 
    176  
    177     if( p_intf->b_block && 
    178         ( !strncmp( p_intf->p_module->psz_object_name, "macosx" , 6 ) || 
    179           !strncmp( p_intf->p_libvlc->psz_object_name, "clivlc", 6 ) ) ) 
    180     { 
    181         /* VLC in normal primary interface mode */ 
    182         RunInterface( p_intf ); 
     164 
     165        if( p_intf->pf_run ) 
     166            RunInterface( p_intf ); 
     167        else 
     168        { 
     169            [NSApp run]; 
     170            while( !intf_ShouldDie( p_intf ) ) 
     171                msleep( INTF_IDLE_SLEEP * 2); 
     172        } 
    183173        p_intf->b_die = VLC_TRUE; 
    184174    } 
    185175    else 
    186     { 
    187         /* This interface doesn't need to be run */ 
    188         if( !p_intf->pf_run ) 
    189             return VLC_SUCCESS; 
    190  
    191         /* Run the interface in a separate thread */ 
     176#endif 
     177    if( p_intf->b_block ) 
     178    { 
     179        /* If we are clivlc+macosx, don't run the macosx GUI */ 
    192180        if( !strcmp( p_intf->p_module->psz_object_name, "macosx" ) ) 
    193181        { 
    194182            msg_Err( p_intf, "You cannot run the MacOS X module as an " 
    195                              "extra interface. Please read the " 
     183                             "interface in clivlc mode. Please read the " 
    196184                             "README.MacOSX.rtf file."); 
    197185            return VLC_EGENERIC; 
    198186        } 
    199         if( vlc_thread_create( p_intf, "interface", RunInterface, 
    200                                VLC_THREAD_PRIORITY_LOW, VLC_FALSE ) ) 
    201         { 
    202             msg_Err( p_intf, "cannot spawn interface thread" ); 
    203             return VLC_EGENERIC; 
    204         } 
    205  
    206         if( p_intf->b_block ) 
    207         { 
    208             /* VLC in primary interface mode with a working macosx vout */ 
    209             [NSApp run]; 
    210             p_intf->b_die = VLC_TRUE; 
    211         } 
    212     } 
    213 #else 
    214     if( p_intf->b_block ) 
    215     { 
     187         
    216188        /* If the main interface does not have a run function, 
    217189         * implement a waiting loop ourselves 
     
    233205 
    234206        /* Run the interface in a separate thread */ 
     207        if( !strcmp( p_intf->p_module->psz_object_name, "macosx" ) ) 
     208        { 
     209            msg_Err( p_intf, "You cannot run the MacOS X module as an " 
     210                             "extra interface. Please read the " 
     211                             "README.MacOSX.rtf file."); 
     212            return VLC_EGENERIC; 
     213        } 
     214 
     215        /* Run the interface in a separate thread */ 
    235216        if( vlc_thread_create( p_intf, "interface", RunInterface, 
    236217                               VLC_THREAD_PRIORITY_LOW, VLC_FALSE ) ) 
     
    240221        } 
    241222    } 
    242 #endif 
    243223 
    244224    return VLC_SUCCESS;