summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@gnome.org>2015-11-17 09:48:57 (GMT)
committerEmanuele Aina <emanuele.aina@collabora.com>2015-11-20 00:24:39 (GMT)
commit512233e236a1f7d48bafec788298cd8bd9563861 (patch)
tree9aeb8c346c64b9ab4a7945825ec5f6ec92e74ffb
parent6fd175e7ddc521e5896f370cbc6037a72fa261a9 (diff)
downloadgst-omx-rpi-1.0.0.1.tar.gz
gst-omx-rpi-1.0.0.1.tar.xz
videodec: Check if we are flushing when negotiation failsrpi-1.0.0.1
And make sure to stop any further tries to reconfigure output port Avoiding deadlocks trying to reconfigure the output port while seeking. Differential Revision: https://phabricator.collabora.co.uk/D341
-rw-r--r--omx/gstomxvideodec.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c
index 33fd2e6..bb1d78b 100644
--- a/omx/gstomxvideodec.c
+++ b/omx/gstomxvideodec.c
@@ -45,6 +45,8 @@
#pragma GCC optimize ("gnu89-inline")
#endif
+#define OMX_ErrorGstFlushing (OMX_ErrorVendorStartUnused + (OMX_S32)0x00001001)
+
#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL)
#include <gst/gl/gl.h>
#include <gst/gl/egl/gsteglimagememory.h>
@@ -2052,7 +2054,15 @@ gst_omx_video_dec_reconfigure_output_port (GstOMXVideoDec * self)
if (!gst_video_decoder_negotiate (GST_VIDEO_DECODER (self))) {
gst_video_codec_state_unref (state);
GST_ERROR_OBJECT (self, "Failed to negotiate RGBA for EGLImage");
+ if (GST_PAD_IS_FLUSHING (GST_VIDEO_DECODER_SRC_PAD (self))) {
+ GST_VIDEO_DECODER_STREAM_UNLOCK (self);
+ GST_DEBUG_OBJECT (self,
+ "Could not negotiate output because srcpad is flushing");
+
+ return OMX_ErrorGstFlushing;
+ }
GST_VIDEO_DECODER_STREAM_UNLOCK (self);
+
goto no_egl;
}
@@ -2586,11 +2596,10 @@ gst_omx_video_dec_loop (GstOMXVideoDec * self)
/* We have the possibility to reconfigure everything now */
g_mutex_lock (&self->drain_lock);
err = gst_omx_video_dec_reconfigure_output_port (self);
- if (self->flushing) {
+ if (self->flushing || (err == OMX_ErrorGstFlushing)) {
g_mutex_unlock (&self->drain_lock);
goto flushing;
}
-
g_mutex_unlock (&self->drain_lock);
if (err != OMX_ErrorNone)
goto reconfigure_error;