[vlc-devel] commit: Use FIND_CHILD when possible to look for the vout as suggested by dionoea and nefrir (Jean-Baptiste Kempf )
git version control
git at videolan.org
Fri Aug 22 23:50:19 CEST 2008
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Aug 22 14:50:07 2008 -0700| [d49615b4ef05da251485238de26c70e2ec349880] | committer: Jean-Baptiste Kempf
Use FIND_CHILD when possible to look for the vout as suggested by dionoea and nefrir
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d49615b4ef05da251485238de26c70e2ec349880
---
modules/gui/qt4/components/extended_panels.cpp | 25 ++++++++++++++---------
1 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/modules/gui/qt4/components/extended_panels.cpp b/modules/gui/qt4/components/extended_panels.cpp
index 77cdc9b..299fe15 100644
--- a/modules/gui/qt4/components/extended_panels.cpp
+++ b/modules/gui/qt4/components/extended_panels.cpp
@@ -94,6 +94,7 @@ ExtVideo::ExtVideo( intf_thread_t *_p_intf, QTabWidget *_parent ) :
p_intf( _p_intf )
{
ui.setupUi( _parent );
+ p_vout = NULL;
#define SETUP_VFILTER( widget ) \
{ \
@@ -221,14 +222,18 @@ ExtVideo::~ExtVideo()
void ExtVideo::cropChange()
{
- p_vout = ( vout_thread_t * )vlc_object_find( p_intf,
- VLC_OBJECT_VOUT, FIND_ANYWHERE );
- if( p_vout )
+ if( THEMIM->getInput() )
{
- var_SetInteger( p_vout, "crop-top", ui.cropTopPx->value() );
- var_SetInteger( p_vout, "crop-bottom", ui.cropBotPx->value() );
- var_SetInteger( p_vout, "crop-left", ui.cropLeftPx->value() );
- var_SetInteger( p_vout, "crop-right", ui.cropRightPx->value() );
+ p_vout = ( vout_thread_t * )vlc_object_find( THEMIM->getInput(),
+ VLC_OBJECT_VOUT, FIND_CHILD );
+ if( p_vout )
+ {
+ var_SetInteger( p_vout, "crop-top", ui.cropTopPx->value() );
+ var_SetInteger( p_vout, "crop-bottom", ui.cropBotPx->value() );
+ var_SetInteger( p_vout, "crop-left", ui.cropLeftPx->value() );
+ var_SetInteger( p_vout, "crop-right", ui.cropRightPx->value() );
+ }
+ vlc_object_release( p_vout );
}
}
@@ -327,8 +332,9 @@ void ExtVideo::ChangeVFiltersString( char *psz_name, bool b_add )
ui.subpictureFilterText->setText( psz_string );
/* Try to set on the fly */
- p_vout = ( vout_thread_t * )vlc_object_find( p_intf, VLC_OBJECT_VOUT,
- FIND_ANYWHERE );
+ if( THEMIM->getInput() )
+ p_vout = ( vout_thread_t * )vlc_object_find( THEMIM->getInput(),
+ VLC_OBJECT_VOUT, FIND_CHILD );
if( p_vout )
{
if( !strcmp( psz_filter_type, "sub-filter" ) )
@@ -344,7 +350,6 @@ void ExtVideo::ChangeVFiltersString( char *psz_name, bool b_add )
void ExtVideo::updateFilters()
{
QString module = ModuleFromWidgetName( sender() );
- //std::cout << "Module name: " << module.toStdString() << std::endl;
QCheckBox *checkbox = qobject_cast<QCheckBox*>( sender() );
QGroupBox *groupbox = qobject_cast<QGroupBox*>( sender() );
More information about the vlc-devel
mailing list