commit 9b59d098a2b8f76964997df4e8666be31d9ba21a
Author: phantomjinx <p.g.richard...@phantomjinx.co.uk>
Date:   Sun May 1 14:49:55 2011 +0100

    Stop segfault when trying to play files with no gsteamer plugins
    
    * If gstreamer plugins have not been installed then it is possible to
      segfault application as the gstreamer factory fails to create a play
      element

 plugins/media_player/media_player.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/plugins/media_player/media_player.c 
b/plugins/media_player/media_player.c
index 44e1fa0..2520f33 100644
--- a/plugins/media_player/media_player.c
+++ b/plugins/media_player/media_player.c
@@ -379,6 +379,11 @@ static void thread_play_song() {
     }
 
     player->play_element = gst_element_factory_make("playbin2", "play");
+    if (!player->play_element) {
+        gtkpod_statusbar_message("Failed to play track: Cannot create a play 
element. Ensure that all gstreamer plugins are installed");
+        return;
+    }
+
     g_object_set(G_OBJECT (player->play_element), "uri", uri, NULL);
     g_object_set(player->play_element, "volume", player->volume_level, NULL);
 

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
gtkpod-cvs2 mailing list
gtkpod-cvs2@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to