[vlc-commits] GTK: check for media_player before use
Cheng Sun
git at videolan.org
Sat Jan 21 22:28:31 CET 2012
npapi-vlc | branch: master | Cheng Sun <chengsun9 at gmail.com> | Sat Jan 21 11:41:17 2012 +0000| [c91e3282cdb29d97697d14f4a745ab1be1d489e9] | committer: Cheng Sun
GTK: check for media_player before use
> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=c91e3282cdb29d97697d14f4a745ab1be1d489e9
---
npapi/vlcplugin_gtk.cpp | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/npapi/vlcplugin_gtk.cpp b/npapi/vlcplugin_gtk.cpp
index 09d70ad..c498b4d 100644
--- a/npapi/vlcplugin_gtk.cpp
+++ b/npapi/vlcplugin_gtk.cpp
@@ -295,14 +295,18 @@ static bool video_expose_handler(GtkWidget *widget, GdkEvent *event, gpointer us
static bool time_slider_handler(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer user_data)
{
VlcPluginGtk *plugin = (VlcPluginGtk *) user_data;
- libvlc_media_player_set_position(plugin->getMD(), value/100.0);
+ libvlc_media_player_t *md = plugin->getMD();
+ if (md)
+ libvlc_media_player_set_position(md, value/100.0);
return false;
}
static bool vol_slider_handler(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer user_data)
{
VlcPluginGtk *plugin = (VlcPluginGtk *) user_data;
- libvlc_audio_set_volume(plugin->getMD(), value);
+ libvlc_media_player_t *md = plugin->getMD();
+ if (md)
+ libvlc_audio_set_volume(md, value);
return false;
}
More information about the vlc-commits
mailing list