omxvideodec: prevent timeout when shutting down because of pending out buffers

The OMX transition state to Loaded won't be complete until all buffers
have been freed. There is no point waiting, and timeout, if we know that
output buffers haven't been freed yet.

The typical scenario is output buffers being still used downstream
and being freed later when released back to the pool.

https://bugzilla.gnome.org/show_bug.cgi?id=796918
This commit is contained in:
Guillaume Desmottes 2018-07-25 09:57:20 +02:00
parent 86a6703d91
commit 0996019c07

View file

@ -408,8 +408,15 @@ gst_omx_video_dec_shutdown (GstOMXVideoDec * self)
gst_omx_component_set_state (self->dec, OMX_StateLoaded); gst_omx_component_set_state (self->dec, OMX_StateLoaded);
gst_omx_port_deallocate_buffers (self->dec_in_port); gst_omx_port_deallocate_buffers (self->dec_in_port);
gst_omx_video_dec_deallocate_output_buffers (self); gst_omx_video_dec_deallocate_output_buffers (self);
if (state > OMX_StateLoaded) if (state > OMX_StateLoaded) {
gst_omx_component_get_state (self->dec, 5 * GST_SECOND); if (self->dec_out_port->buffers)
/* Don't wait for the state transition if the pool still has outstanding
* buffers as it will timeout anyway */
GST_WARNING_OBJECT (self,
"Output buffers haven't been freed; still owned downstream?");
else
gst_omx_component_get_state (self->dec, 5 * GST_SECOND);
}
} }
return TRUE; return TRUE;