Commit 3d52fe95 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf
Browse files

Qt: use getVout in menus

Remove a bunch of ( vlc_object_t * )vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
and FIND_CHILD there.
parent c7a5e17e
...@@ -185,7 +185,7 @@ static int InputAutoMenuBuilder( vlc_object_t *p_object, ...@@ -185,7 +185,7 @@ static int InputAutoMenuBuilder( vlc_object_t *p_object,
return VLC_SUCCESS; return VLC_SUCCESS;
} }
static int VideoAutoMenuBuilder( vlc_object_t *p_object, static int VideoAutoMenuBuilder( vout_thread_t *p_object,
input_thread_t *p_input, input_thread_t *p_input,
vector<vlc_object_t *> &objects, vector<vlc_object_t *> &objects,
vector<const char *> &varnames ) vector<const char *> &varnames )
...@@ -204,6 +204,7 @@ static int VideoAutoMenuBuilder( vlc_object_t *p_object, ...@@ -204,6 +204,7 @@ static int VideoAutoMenuBuilder( vlc_object_t *p_object,
PUSH_VAR( "video-snapshot" ); PUSH_VAR( "video-snapshot" );
/* Special case for postproc */ /* Special case for postproc */
// FIXME
if( p_object ) if( p_object )
{ {
/* p_object is the vout, so the decoder is our parent and the /* p_object is the vout, so the decoder is our parent and the
...@@ -218,7 +219,7 @@ static int VideoAutoMenuBuilder( vlc_object_t *p_object, ...@@ -218,7 +219,7 @@ static int VideoAutoMenuBuilder( vlc_object_t *p_object,
FIND_CHILD ); FIND_CHILD );
if( p_pp ) if( p_pp )
{ {
p_object = p_pp; vlc_object_t *p_object = p_pp;
PUSH_VAR( "postproc-q" ); PUSH_VAR( "postproc-q" );
vlc_object_release( p_pp ); vlc_object_release( p_pp );
} }
...@@ -513,7 +514,7 @@ QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current ) ...@@ -513,7 +514,7 @@ QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current )
**/ **/
QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current ) QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current )
{ {
vlc_object_t *p_vout; vout_thread_t *p_vout;
input_thread_t *p_input; input_thread_t *p_input;
vector<vlc_object_t *> objects; vector<vlc_object_t *> objects;
vector<const char *> varnames; vector<const char *> varnames;
...@@ -548,8 +549,7 @@ QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current ) ...@@ -548,8 +549,7 @@ QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current )
p_input = THEMIM->getInput(); p_input = THEMIM->getInput();
if( p_input ) if( p_input )
vlc_object_hold( p_input ); vlc_object_hold( p_input );
p_vout = ( vlc_object_t * )vlc_object_find( p_intf, VLC_OBJECT_VOUT, p_vout = THEMIM->getVout();
FIND_ANYWHERE );
VideoAutoMenuBuilder( p_vout, p_input, objects, varnames ); VideoAutoMenuBuilder( p_vout, p_input, objects, varnames );
...@@ -741,8 +741,7 @@ void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf ) ...@@ -741,8 +741,7 @@ void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf )
if( p_input ) if( p_input )
{ {
vlc_object_hold( p_input ); vlc_object_hold( p_input );
vlc_object_t *p_vout = ( vlc_object_t * )vlc_object_find( p_input, vout_thread_t *p_vout = THEMIM->getVout();
VLC_OBJECT_VOUT, FIND_CHILD );
if( p_vout ) if( p_vout )
{ {
VideoAutoMenuBuilder( p_vout, p_input, objects, varnames ); VideoAutoMenuBuilder( p_vout, p_input, objects, varnames );
...@@ -821,8 +820,7 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show ) ...@@ -821,8 +820,7 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
if( p_input ) if( p_input )
{ {
vlc_object_t *p_vout = (vlc_object_t *) vout_thread_t *p_vout = THEMIM->getVout();
vlc_object_find( p_input, VLC_OBJECT_VOUT, FIND_CHILD );
/* Add a fullscreen switch button */ /* Add a fullscreen switch button */
if( p_vout ) if( p_vout )
...@@ -1120,8 +1118,7 @@ void QVLCMenu::UpdateItem( intf_thread_t *p_intf, QMenu *menu, ...@@ -1120,8 +1118,7 @@ void QVLCMenu::UpdateItem( intf_thread_t *p_intf, QMenu *menu,
bool forceDisabled = false; bool forceDisabled = false;
if( !strcmp( psz_var, "spu-es" ) ) if( !strcmp( psz_var, "spu-es" ) )
{ {
vlc_object_t *p_vout = ( vlc_object_t* )( vlc_object_find( p_intf, vlc_object_t *p_vout = THEMIM->getVout();
VLC_OBJECT_VOUT, FIND_ANYWHERE ) );
forceDisabled = ( p_vout == NULL ); forceDisabled = ( p_vout == NULL );
if( p_vout ) if( p_vout )
vlc_object_release( p_vout ); vlc_object_release( p_vout );
......
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