[vlc-commits] skins2: adapt to latest change in playlist (activity variable)
Erwan Tulou
git at videolan.org
Tue Dec 4 16:12:09 CET 2012
vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Tue Dec 4 15:59:41 2012 +0100| [ab74d69921d20be6854a94da37052c919623a92a] | committer: Erwan Tulou
skins2: adapt to latest change in playlist (activity variable)
It fixes skins2 crashing when an input is started.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ab74d69921d20be6854a94da37052c919623a92a
---
modules/gui/skins2/src/vlcproc.cpp | 15 +++++++++++----
modules/gui/skins2/src/vlcproc.hpp | 2 +-
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/modules/gui/skins2/src/vlcproc.cpp b/modules/gui/skins2/src/vlcproc.cpp
index 96e1b4e..e19c61b 100644
--- a/modules/gui/skins2/src/vlcproc.cpp
+++ b/modules/gui/skins2/src/vlcproc.cpp
@@ -367,7 +367,7 @@ int VlcProc::onGenericCallback( vlc_object_t *pObj, const char *pVariable,
} \
}
- ADD_CALLBACK_ENTRY( "activity", on_item_current_changed, false )
+ ADD_CALLBACK_ENTRY( "activity", on_activity_changed, false )
ADD_CALLBACK_ENTRY( "volume", on_volume_changed, true )
ADD_CALLBACK_ENTRY( "bit-rate", on_bit_rate_changed, false )
@@ -444,10 +444,17 @@ int VlcProc::onGenericCallback2( vlc_object_t *pObj, const char *pVariable,
}
-void VlcProc::on_item_current_changed( vlc_object_t* p_obj, vlc_value_t newVal )
+void VlcProc::on_activity_changed( vlc_object_t* p_obj, vlc_value_t newVal )
{
- (void)p_obj;
- input_item_t *p_item = static_cast<input_item_t*>(newVal.p_address);
+ (void)p_obj; (void)newVal;
+
+ input_thread_t *p_input = getIntf()->p_sys->p_input;
+ if( !p_input )
+ return;
+
+ input_item_t *p_item = input_GetItem( p_input );
+ if( !p_item )
+ return;
// Update short name
char *psz_name = input_item_GetName( p_item );
diff --git a/modules/gui/skins2/src/vlcproc.hpp b/modules/gui/skins2/src/vlcproc.hpp
index 8cf36a2..0048842 100644
--- a/modules/gui/skins2/src/vlcproc.hpp
+++ b/modules/gui/skins2/src/vlcproc.hpp
@@ -98,7 +98,7 @@ public:
/// update equalizer
void update_equalizer( );
- void on_item_current_changed( vlc_object_t* p_obj, vlc_value_t newVal );
+ void on_activity_changed( vlc_object_t* p_obj, vlc_value_t newVal );
void on_intf_event_changed( vlc_object_t* p_obj, vlc_value_t newVal );
void on_bit_rate_changed( vlc_object_t* p_obj, vlc_value_t newVal );
void on_sample_rate_changed( vlc_object_t* p_obj, vlc_value_t newVal );
More information about the vlc-commits
mailing list