mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
gst_omx_port_set_flushing: simplify waiting loop
No semantic change so far, I just made the 'while' end condition easier to understand as a first step before changing it. - move error/time out checks inside the loop to make it clearer on what we are actually waiting for. - group port->buffers checks together with parenthesis as they are part of the same conceptual check: waiting for all buffers to be released. https://bugzilla.gnome.org/show_bug.cgi?id=789475
This commit is contained in:
parent
0b4931236b
commit
4c0a8a6d90
1 changed files with 8 additions and 3 deletions
11
omx/gstomx.c
11
omx/gstomx.c
|
@ -1562,14 +1562,19 @@ gst_omx_port_set_flushing (GstOMXPort * port, GstClockTime timeout,
|
||||||
signalled = TRUE;
|
signalled = TRUE;
|
||||||
last_error = OMX_ErrorNone;
|
last_error = OMX_ErrorNone;
|
||||||
gst_omx_component_handle_messages (comp);
|
gst_omx_component_handle_messages (comp);
|
||||||
while (signalled && last_error == OMX_ErrorNone && !port->flushed
|
while (!port->flushed &&
|
||||||
&& port->buffers
|
(port->buffers
|
||||||
&& port->buffers->len > g_queue_get_length (&port->pending_buffers)) {
|
&& port->buffers->len >
|
||||||
|
g_queue_get_length (&port->pending_buffers))) {
|
||||||
signalled = gst_omx_component_wait_message (comp, timeout);
|
signalled = gst_omx_component_wait_message (comp, timeout);
|
||||||
if (signalled)
|
if (signalled)
|
||||||
gst_omx_component_handle_messages (comp);
|
gst_omx_component_handle_messages (comp);
|
||||||
|
|
||||||
last_error = comp->last_error;
|
last_error = comp->last_error;
|
||||||
|
|
||||||
|
if (!signalled || last_error != OMX_ErrorNone)
|
||||||
|
/* Something gone wrong or we timed out */
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
port->flushed = FALSE;
|
port->flushed = FALSE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue