From 0a92d1d5ea88919e5ab42deef76a95b1b9bc0052 Mon Sep 17 00:00:00 2001 From: maroy Date: Mon, 5 Sep 2005 10:36:39 +0000 Subject: [PATCH] added null-checks around calls in close() see http://bugs.campware.org/view.php?id=1444 --- .../playlistExecutor/src/GstreamerPlayer.cxx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/livesupport/modules/playlistExecutor/src/GstreamerPlayer.cxx b/livesupport/modules/playlistExecutor/src/GstreamerPlayer.cxx index cf178865e..5a54e5435 100644 --- a/livesupport/modules/playlistExecutor/src/GstreamerPlayer.cxx +++ b/livesupport/modules/playlistExecutor/src/GstreamerPlayer.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.12 $ + Version : $Revision: 1.13 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/GstreamerPlayer.cxx,v $ ------------------------------------------------------------------------------*/ @@ -444,10 +444,18 @@ GstreamerPlayer :: close(void) throw () } gst_element_set_state(pipeline, GST_STATE_NULL); - gst_element_unlink(filesrc, decoder); - gst_element_unlink(decoder, audiosink); - gst_bin_remove(GST_BIN(pipeline), decoder); - gst_bin_remove(GST_BIN(pipeline), filesrc); + if (filesrc && decoder) { + gst_element_unlink(filesrc, decoder); + } + if (decoder && audiosink) { + gst_element_unlink(decoder, audiosink); + } + if (decoder) { + gst_bin_remove(GST_BIN(pipeline), decoder); + } + if (filesrc) { + gst_bin_remove(GST_BIN(pipeline), filesrc); + } filesrc = 0; decoder = 0; }