ignore pause,unpause when not in 'running'-state
authorFelix Domke <tmbinc@elitedvb.net>
Mon, 6 Apr 2009 12:29:38 +0000 (14:29 +0200)
committerFelix Domke <tmbinc@elitedvb.net>
Mon, 6 Apr 2009 12:29:38 +0000 (14:29 +0200)
lib/service/servicemp3.cpp

index 006c6e9..80356dc 100644 (file)
@@ -696,6 +696,9 @@ void eServiceMP3::seekTimeoutCB()
                // iPausableService
 RESULT eServiceMP3::pause()
 {
                // iPausableService
 RESULT eServiceMP3::pause()
 {
+       if (m_state != stRunning)
+               return;
+       
        if (!m_gst_pipeline)
                return -1;
        GstStateChangeReturn res = gst_element_set_state(m_gst_pipeline, GST_STATE_PAUSED);
        if (!m_gst_pipeline)
                return -1;
        GstStateChangeReturn res = gst_element_set_state(m_gst_pipeline, GST_STATE_PAUSED);
@@ -710,6 +713,9 @@ RESULT eServiceMP3::pause()
 
 RESULT eServiceMP3::unpause()
 {
 
 RESULT eServiceMP3::unpause()
 {
+       if (m_state != stRunning)
+               return;
+
        if (!m_gst_pipeline)
                return -1;
 
        if (!m_gst_pipeline)
                return -1;