Commit 531b372e authored by Cheng Sun's avatar Cheng Sun

GTK: check for media_player before use

parent f64fea49
......@@ -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;
}
......
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