diff options
author | Enrique Ocaña González <eocanha@igalia.com> | 2015-11-18 13:00:28 +0000 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-11-18 15:18:02 +0200 |
commit | 271093d6338f01501fc0bb1965e90f6b441f62fb (patch) | |
tree | 2f2e8587d1646cd82045ce65144305c52a3aece8 | |
parent | d1a79d7c591fbe68f2048bcfb02a14ba49c312e4 (diff) |
Remember the last_error after a failed set state call to avoid blocking the next get state call
gst_omx_video_dec_flush() blocks forever in
http://cgit.freedesktop.org/gstreamer/gst-omx/tree/omx/gstomxvideodec.c?id=9adf0ff82903cad5331e40975ae91ed5d11bc102#n2110
when the previous call to gst_omx_component_set_state() fails in
http://cgit.freedesktop.org/gstreamer/gst-omx/tree/omx/gstomx.c?id=9adf0ff82903cad5331e40975ae91ed5d11bc102#n827.
To mitigate that, I set "last_error" to true, so the code in
http://cgit.freedesktop.org/gstreamer/gst-omx/tree/omx/gstomx.c?id=9adf0ff82903cad5331e40975ae91ed5d11bc102#n862
exits early and doesn't block.
https://bugzilla.gnome.org/show_bug.cgi?id=758274
-rw-r--r-- | omx/gstomx.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/omx/gstomx.c b/omx/gstomx.c index 5dfb4ea..7b64aab 100644 --- a/omx/gstomx.c +++ b/omx/gstomx.c @@ -830,6 +830,13 @@ gst_omx_component_set_state (GstOMXComponent * comp, OMX_STATETYPE state) done: gst_omx_component_handle_messages (comp); + + if (err != OMX_ErrorNone && comp->last_error == OMX_ErrorNone) { + GST_ERROR_OBJECT (comp->parent, + "Last operation returned an error. Setting last_error manually."); + comp->last_error = err; + } + g_mutex_unlock (&comp->lock); if (err != OMX_ErrorNone) { |