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
This commit is contained in:
Enrique Ocaña González 2015-11-18 13:00:28 +00:00 committed by Sebastian Dröge
parent d1a79d7c59
commit 271093d633

View file

@ -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) {