Changeset ef066dadd58ccecc690eddedafce4ae4bb1f724a
- 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
| rd38407e |
ref066da |
|
| 155 | 155 | NSAutoreleasePool * o_pool; |
|---|
| 156 | 156 | |
|---|
| 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 */ |
|---|
| 169 | 158 | if( p_intf->b_block && strncmp( p_intf->p_libvlc->psz_object_name, |
|---|
| 170 | 159 | "clivlc", 6) ) |
|---|
| … | … | |
| 173 | 162 | [VLCApplication sharedApplication]; |
|---|
| 174 | 163 | [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 | } |
|---|
| 183 | 173 | p_intf->b_die = VLC_TRUE; |
|---|
| 184 | 174 | } |
|---|
| 185 | 175 | 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 */ |
|---|
| 192 | 180 | if( !strcmp( p_intf->p_module->psz_object_name, "macosx" ) ) |
|---|
| 193 | 181 | { |
|---|
| 194 | 182 | 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 " |
|---|
| 196 | 184 | "README.MacOSX.rtf file."); |
|---|
| 197 | 185 | return VLC_EGENERIC; |
|---|
| 198 | 186 | } |
|---|
| 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 | |
|---|
| 216 | 188 | /* If the main interface does not have a run function, |
|---|
| 217 | 189 | * implement a waiting loop ourselves |
|---|
| … | … | |
| 233 | 205 | |
|---|
| 234 | 206 | /* 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 */ |
|---|
| 235 | 216 | if( vlc_thread_create( p_intf, "interface", RunInterface, |
|---|
| 236 | 217 | VLC_THREAD_PRIORITY_LOW, VLC_FALSE ) ) |
|---|
| … | … | |
| 240 | 221 | } |
|---|
| 241 | 222 | } |
|---|
| 242 | | #endif |
|---|
| 243 | 223 | |
|---|
| 244 | 224 | return VLC_SUCCESS; |
|---|