omxaudiosink: Set port to not flushing in prepare() and keep it at flushing in unprep...
authorSebastian Dröge <sebastian@centricular.com>
Sun, 20 Jul 2014 15:46:30 +0000 (17:46 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Sun, 20 Jul 2014 15:47:50 +0000 (17:47 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=733168

omx/gstomxaudiosink.c

index 6f1daeb..1739739 100644 (file)
@@ -318,14 +318,14 @@ gst_omx_audio_sink_open (GstAudioSink * audiosink)
 
   err = gst_omx_port_set_enabled (self->in_port, FALSE);
   if (err != OMX_ErrorNone) {
-    GST_ERROR_OBJECT (self, "Failed to enable port: %s (0x%08x)",
+    GST_ERROR_OBJECT (self, "Failed to disable port: %s (0x%08x)",
         gst_omx_error_to_string (err), err);
     return FALSE;
   }
 
   err = gst_omx_port_set_enabled (self->out_port, FALSE);
   if (err != OMX_ErrorNone) {
-    GST_ERROR_OBJECT (self, "Failed to enable port: %s (0x%08x)",
+    GST_ERROR_OBJECT (self, "Failed to disable port: %s (0x%08x)",
         gst_omx_error_to_string (err), err);
     return FALSE;
   }
@@ -589,6 +589,13 @@ gst_omx_audio_sink_prepare (GstAudioSink * audiosink,
     goto activation;
   }
 
+  err = gst_omx_port_set_flushing (self->in_port, 5 * GST_SECOND, FALSE);
+  if (err != OMX_ErrorNone) {
+    GST_ERROR_OBJECT (self, "Failed to set port not flushing: %s (0x%08x)",
+        gst_omx_error_to_string (err), err);
+    goto activation;
+  }
+
   err = gst_omx_port_set_enabled (self->in_port, TRUE);
   if (err != OMX_ErrorNone) {
     GST_ERROR_OBJECT (self, "Failed to enable port: %s (0x%08x)",
@@ -729,13 +736,6 @@ gst_omx_audio_sink_unprepare (GstAudioSink * audiosink)
     goto failed;
   }
 
-  err = gst_omx_port_set_flushing (self->in_port, 5 * GST_SECOND, FALSE);
-  if (err != OMX_ErrorNone) {
-    GST_ERROR_OBJECT (self, "Failed to set port not flushing: %s (0x%08x)",
-        gst_omx_error_to_string (err), err);
-    goto failed;
-  }
-
   gst_omx_component_get_state (self->comp, GST_CLOCK_TIME_NONE);
 
   return TRUE;