Commit 656bdcea authored by Sam Hocevar's avatar Sam Hocevar

* ./modules/gui/macosx/vout.m: if no MacOS X interface is available when

    the video output is initialized, we wait for a while before giving up;
    also changed the code so that it probes all interface objects rather than
    the first one it finds.
parent 2b0b7888
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout.m: MacOS X video output plugin * vout.m: MacOS X video output plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: vout.m,v 1.2 2002/08/07 21:36:56 massiot Exp $ * $Id: vout.m,v 1.3 2002/10/04 14:02:20 sam Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org> * Florian G. Pflug <fgp@phlo.org>
...@@ -80,6 +80,7 @@ int E_(OpenVideo) ( vlc_object_t *p_this ) ...@@ -80,6 +80,7 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
{ {
vout_thread_t * p_vout = (vout_thread_t *)p_this; vout_thread_t * p_vout = (vout_thread_t *)p_this;
OSErr err; OSErr err;
int i_timeout;
p_vout->p_sys = malloc( sizeof( vout_sys_t ) ); p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL ) if( p_vout->p_sys == NULL )
...@@ -90,21 +91,35 @@ int E_(OpenVideo) ( vlc_object_t *p_this ) ...@@ -90,21 +91,35 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) ); memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
p_vout->p_sys->p_intf = vlc_object_find( p_vout, VLC_OBJECT_INTF, /* Wait for a MacOS X interface to appear. Timeout is 2 seconds. */
for( i_timeout = 20 ; i_timeout-- ; )
{
vlc_list_t * p_list = vlc_list_find( p_vout, VLC_OBJECT_INTF,
FIND_ANYWHERE ); FIND_ANYWHERE );
intf_thread_t ** pp_intf = (intf_thread_t **)p_list->pp_objects;
/* Parse the list of interfaces to see if one suits us */
for( ; *pp_intf ; pp_intf++ )
{
if( (*pp_intf)->p_module &&
!strcmp( (*pp_intf)->p_module->psz_object_name, MODULE_STRING ) )
{
vlc_object_yield( *pp_intf );
p_vout->p_sys->p_intf = *pp_intf;
break;
}
}
vlc_list_release( p_list );
if( p_vout->p_sys->p_intf == NULL ) if( p_vout->p_sys->p_intf == NULL )
{ {
msg_Err( p_vout, "no interface present" ); msleep( INTF_IDLE_SLEEP );
free( p_vout->p_sys ); }
return( 1 );
} }
if( p_vout->p_sys->p_intf->p_module == NULL || if( p_vout->p_sys->p_intf == NULL )
strcmp( p_vout->p_sys->p_intf->p_module->psz_object_name,
MODULE_STRING ) != 0 )
{ {
msg_Err( p_vout, "MacOS X interface module required" ); msg_Err( p_vout, "no MacOS X interface present" );
vlc_object_release( p_vout->p_sys->p_intf );
free( p_vout->p_sys ); free( p_vout->p_sys );
return( 1 ); return( 1 );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment