From 5b751a18094cdb446d272fa083a7fd05ee338cc6 Mon Sep 17 00:00:00 2001 From: maroy Date: Tue, 12 Jul 2005 06:09:55 +0000 Subject: [PATCH] fixed firing of onStop events, that was fires also at pause, and prematurely (one coudln't call close() from the event handler) fix for issue #1248, see http://bugs.campware.org/view.php?id=1248 --- .../playlistExecutor/src/GstreamerPlayer.cxx | 22 ++----------------- .../playlistExecutor/src/GstreamerPlayer.h | 20 ++--------------- 2 files changed, 4 insertions(+), 38 deletions(-) diff --git a/livesupport/modules/playlistExecutor/src/GstreamerPlayer.cxx b/livesupport/modules/playlistExecutor/src/GstreamerPlayer.cxx index b7dd713d3..088bfd96f 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.5 $ + Version : $Revision: 1.6 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/GstreamerPlayer.cxx,v $ ------------------------------------------------------------------------------*/ @@ -107,7 +107,6 @@ GstreamerPlayer :: initialize(void) throw (std::exception) gst_object_sink(GST_OBJECT(pipeline)); g_signal_connect(pipeline, "error", G_CALLBACK(errorHandler), this); - g_signal_connect(pipeline, "state-change", G_CALLBACK(stateChange), this); setAudioDevice(audioDevice); @@ -132,24 +131,6 @@ GstreamerPlayer :: errorHandler(GstElement * pipeline, } -/*------------------------------------------------------------------------------ - * Event handler for when the state of the pipeline changes - *----------------------------------------------------------------------------*/ -void -GstreamerPlayer :: stateChange(GstElement * element, - gint oldState, - gint newState, - gpointer self) - throw () -{ - GstreamerPlayer * player = (GstreamerPlayer*) self; - - if (oldState == GST_STATE_PLAYING && newState != GST_STATE_PLAYING) { - player->fireOnStopEvent(); - } -} - - /*------------------------------------------------------------------------------ * De-initialize the Gstreamer Player *----------------------------------------------------------------------------*/ @@ -232,6 +213,7 @@ GstreamerPlayer :: eosEventHandler(GstElement * element, GstreamerPlayer * player = (GstreamerPlayer*) self; gst_element_set_eos(player->pipeline); + player->fireOnStopEvent(); } diff --git a/livesupport/modules/playlistExecutor/src/GstreamerPlayer.h b/livesupport/modules/playlistExecutor/src/GstreamerPlayer.h index e15c05cdc..823ff008b 100644 --- a/livesupport/modules/playlistExecutor/src/GstreamerPlayer.h +++ b/livesupport/modules/playlistExecutor/src/GstreamerPlayer.h @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.6 $ + Version : $Revision: 1.7 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/GstreamerPlayer.h,v $ ------------------------------------------------------------------------------*/ @@ -86,7 +86,7 @@ using namespace LiveSupport::Core; * * * @author $Author: maroy $ - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ */ class GstreamerPlayer : virtual public Configurable, virtual public AudioPlayerInterface @@ -162,22 +162,6 @@ class GstreamerPlayer : virtual public Configurable, gchar * debug, gpointer self) throw (); - /** - * Event handler for the state change event on the pipeline. - * Use this to catch events like playing has ended. - * - * @param element the pipeline the event change has occured at - * @param oldState the old state - * @param newState the new state - * @param self a pointer to the associated GstreamerPlayer object. - */ - static void - stateChange(GstElement * element, - gint oldState, - gint newState, - gpointer self) - throw (); - /** * An end-of-stream event handler, that will notify our pipeline, * that it's all over.