Handle asynchronous get state return using timeout.
authorMrinmayee Hingolikar <mrinmayee@ti.com>
Thu, 10 Jan 2013 23:40:53 +0000 (05:10 +0530)
committerMrinmayee <mrinmayee@ubuntu.(none)>
Thu, 10 Jan 2013 23:40:53 +0000 (05:10 +0530)
src/gst-controller.c

index b147f1c76b4e5b8f3a1a2134d803a5848ba0e0f6..7a26542a1b8b8da88c3932d1becf9b1837daada8 100644 (file)
@@ -203,12 +203,15 @@ gboolean DualDecode_seekMedia(Pipeline *pipePtr, gint64 position)
 gboolean DualDecode_pauseMedia (Pipeline *pipePtr)
 {
     gboolean ret = TRUE;
+    GstStateChangeReturn stateReturn;
     if (GST_STATE_CHANGE_ASYNC == gst_element_set_state (pipePtr->pipe, GST_STATE_PAUSED)){
-        g_print ("SET CHANGE RETURNED ASYNC \n");
-        gst_element_get_state (pipePtr->pipe,
+        g_print ("STATE CHANGE RETURNED ASYNC \n");
+        stateReturn = gst_element_get_state (pipePtr->pipe,
                                 NULL,
                                 NULL,
-                                GST_CLOCK_TIME_NONE);
+                                TIMEOUT);
+        g_print ("GET STATE RETURNED %s\n", gst_element_state_change_return_get_name (stateReturn));
+    
     }    
     return ret;
 }
@@ -235,7 +238,7 @@ gboolean DualDecode_stopMedia (Pipeline *pipePtr)
 gboolean DualDecode_setLogFunction (Pipeline *pipePtr, LogFunc func, gpointer data)
 {
     gboolean ret = TRUE;
-    
+     
 
     return ret;   
 }