Commit 8192c527 authored by Thomas Guillem's avatar Thomas Guillem

qt: use vlc_player_GetV4l2Object

parent 39d5cebe
......@@ -635,7 +635,8 @@ void ExtV4l2::showEvent( QShowEvent *event )
void ExtV4l2::Refresh( void )
{
vlc_object_t *p_obj = (vlc_object_t *)p_intf->p_sys->p_player;
vlc_player_Lock(p_intf->p_sys->p_player);
vlc_object_t *p_obj = vlc_player_GetV4l2Object(p_intf->p_sys->p_player);
help->hide();
if( box )
{
......@@ -644,7 +645,7 @@ void ExtV4l2::Refresh( void )
box = NULL;
}
if( p_obj != NULL && var_Type(p_obj, "controls") )
if( p_obj != NULL )
{
vlc_value_t *val;
char **text;
......@@ -785,6 +786,7 @@ void ExtV4l2::Refresh( void )
if ( isVisible() )
QTimer::singleShot( 2000, this, SLOT(Refresh()) );
}
vlc_player_Unlock(p_intf->p_sys->p_player);
}
void ExtV4l2::ValueChange( bool value )
......@@ -795,7 +797,8 @@ void ExtV4l2::ValueChange( bool value )
void ExtV4l2::ValueChange( int value )
{
QObject *s = sender();
vlc_object_t *p_obj = (vlc_object_t *)p_intf->p_sys->p_player;
vlc_player_Lock(p_intf->p_sys->p_player);
vlc_object_t *p_obj = vlc_player_GetV4l2Object(p_intf->p_sys->p_player);
if( p_obj )
{
QString var = s->objectName();
......@@ -817,9 +820,11 @@ void ExtV4l2::ValueChange( int value )
var_TriggerCallback( p_obj, qtu( var ) );
break;
}
vlc_player_Unlock(p_intf->p_sys->p_player);
}
else
{
vlc_player_Unlock(p_intf->p_sys->p_player);
msg_Warn( p_intf, "Oops, v4l2 object isn't available anymore" );
Refresh();
}
......
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