Changeset f02445b5a33a8e657497bc00b59c7520f3f1c8a8
- Timestamp:
- 15/09/07 17:27:13 (1 year ago)
- git-parent:
- Files:
-
- include/vlc_interface.h (modified) (1 diff)
- modules/codec/cmml/cmml.c (modified) (1 diff)
- modules/control/ntservice.c (modified) (1 diff)
- modules/control/rc.c (modified) (1 diff)
- src/interface/interface.c (modified) (4 diffs)
- src/libvlc-common.c (modified) (2 diffs)
- src/video_output/vout_intf.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
include/vlc_interface.h
r25314fa rf02445b 55 55 56 56 /* Thread properties and locks */ 57 vlc_bool_t b_block;58 57 vlc_bool_t b_play; 59 58 modules/codec/cmml/cmml.c
r6ee1e19 rf02445b 128 128 /* initialise the CMML responder interface */ 129 129 p_sys->p_intf = intf_Create( p_dec, "cmml", 0, NULL ); 130 p_sys->p_intf->b_block = VLC_FALSE;131 130 intf_RunThread( p_sys->p_intf ); 132 131 modules/control/ntservice.c
r81c5ac2 rf02445b 325 325 326 326 /* Try to run the interface */ 327 p_new_intf->b_block = VLC_FALSE;328 327 if( intf_RunThread( p_new_intf ) ) 329 328 { modules/control/rc.c
r7b75f68 rf02445b 1463 1463 if( p_newintf ) 1464 1464 { 1465 p_newintf->b_block = VLC_FALSE;1466 1465 if( intf_RunThread( p_newintf ) ) 1467 1466 { src/interface/interface.c
r6ee1e19 rf02445b 137 137 * intf_RunThread: launch the interface thread 138 138 ***************************************************************************** 139 * This function either creates a new thread and runs the interface in it, 140 * or runs the interface in the current thread, depending on b_block. 139 * This function either creates a new thread and runs the interface in it. 141 140 *****************************************************************************/ 142 141 /** 143 * Run the interface thread. 144 * 145 * If b_block is not set, runs the interface in the thread, else, 146 * creates a new thread and runs the interface. 142 * Starts and runs the interface thread. 143 * 147 144 * \param p_intf the interface thread 148 145 * \return VLC_SUCCESS on success, an error number else … … 173 170 else 174 171 #endif 175 if( p_intf->b_block ) 176 { 177 /* If we are clivlc+macosx, don't run the macosx GUI */ 178 if( !strcmp( p_intf->p_module->psz_object_name, "macosx" ) ) 179 { 180 msg_Err( p_intf, "You cannot run the MacOS X module as an " 181 "interface in clivlc mode. Please read the " 182 "README.MacOSX.rtf file."); 183 return VLC_EGENERIC; 184 } 185 186 /* If the main interface does not have a run function, 187 * implement a waiting loop ourselves 188 */ 189 if( p_intf->pf_run ) 190 RunInterface( p_intf ); 191 else 192 { 193 while( !intf_ShouldDie( p_intf ) ) 194 msleep( INTF_IDLE_SLEEP * 2); 195 } 196 vlc_object_kill( p_intf ); 197 } 198 else 199 { 200 /* This interface doesn't need to be run */ 201 if( !p_intf->pf_run ) 202 return VLC_SUCCESS; 203 204 /* Run the interface in a separate thread */ 205 if( !strcmp( p_intf->p_module->psz_object_name, "macosx" ) ) 206 { 207 msg_Err( p_intf, "You cannot run the MacOS X module as an " 208 "extra interface. Please read the " 209 "README.MacOSX.rtf file."); 210 return VLC_EGENERIC; 211 } 212 213 /* Run the interface in a separate thread */ 214 if( vlc_thread_create( p_intf, "interface", RunInterface, 215 VLC_THREAD_PRIORITY_LOW, VLC_FALSE ) ) 216 { 217 msg_Err( p_intf, "cannot spawn interface thread" ); 218 return VLC_EGENERIC; 219 } 172 173 /* This interface doesn't need to be run */ 174 if( p_intf->pf_run == NULL ) 175 return VLC_SUCCESS; 176 177 /* Run the interface in a separate thread */ 178 if( !strcmp( p_intf->p_module->psz_object_name, "macosx" ) ) 179 { 180 msg_Err( p_intf, "You cannot run the MacOS X module as an " 181 "extra interface. Please read the " 182 "README.MacOSX.rtf file."); 183 return VLC_EGENERIC; 184 } 185 186 /* Run the interface in a separate thread */ 187 if( vlc_thread_create( p_intf, "interface", RunInterface, 188 VLC_THREAD_PRIORITY_LOW, VLC_FALSE ) ) 189 { 190 msg_Err( p_intf, "cannot spawn interface thread" ); 191 return VLC_EGENERIC; 220 192 } 221 193 … … 233 205 { 234 206 /* Tell the interface to die */ 235 if( !p_intf->b_block ) 236 { 237 vlc_object_kill( p_intf ); 238 if( p_intf->pf_run ) 239 { 240 vlc_cond_signal( &p_intf->object_wait ); 241 vlc_thread_join( p_intf ); 242 } 207 vlc_object_kill( p_intf ); 208 if( p_intf->pf_run != NULL ) 209 { 210 vlc_cond_signal( &p_intf->object_wait ); 211 vlc_thread_join( p_intf ); 243 212 } 244 213 } … … 427 396 428 397 /* Try to run the interface */ 429 p_intf->b_block = VLC_FALSE;430 398 if( intf_RunThread( p_intf ) != VLC_SUCCESS ) 431 399 { src/libvlc-common.c
r6ee1e19 rf02445b 1133 1133 /* Try to run the interface */ 1134 1134 p_intf->b_play = b_play; 1135 p_intf->b_block = b_block;1136 1135 i_err = intf_RunThread( p_intf ); 1137 1136 if( i_err ) … … 1142 1141 return i_err; 1143 1142 } 1143 1144 if( b_block ) 1145 { 1146 /* FIXME: should be moved to interface/interface.c */ 1147 if( p_intf->pf_run ) 1148 vlc_thread_join( p_intf ); 1149 else 1150 { 1151 vlc_mutex_lock( &p_intf->object_lock ); 1152 vlc_cond_wait( &p_intf->object_wait, &p_intf->object_lock ); 1153 vlc_mutex_unlock( &p_intf->object_lock ); 1154 } 1155 vlc_object_detach( p_intf ); 1156 intf_Destroy( p_intf ); 1157 } 1158 1144 1159 return VLC_SUCCESS; 1145 1160 }; src/video_output/vout_intf.c
r6ee1e19 rf02445b 108 108 { 109 109 p_intf = (intf_thread_t *)p_list->p_values[i].p_object; 110 if( p_intf-> b_block && p_intf->pf_request_window ) break;110 if( p_intf->pf_request_window ) break; 111 111 p_intf = NULL; 112 112 }
