summaryrefslogtreecommitdiff
path: root/omx
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2018-07-25 09:57:20 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2018-08-30 10:59:30 +0200
commit0996019c079fadd3dd84ac57078e906df93c90c6 (patch)
tree4e74012f6dbc79f77feffbc7608feeabdac4f0cf /omx
parent86a6703d918e932ef9bd3d0618fd7d5e52e3a94d (diff)
downloadgst-omx-0996019c079fadd3dd84ac57078e906df93c90c6.tar.gz
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
Diffstat (limited to 'omx')
-rw-r--r--omx/gstomxvideodec.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c
index 6791fb7..5f86da5 100644
--- a/omx/gstomxvideodec.c
+++ b/omx/gstomxvideodec.c
@@ -408,8 +408,15 @@ gst_omx_video_dec_shutdown (GstOMXVideoDec * self)
gst_omx_component_set_state (self->dec, OMX_StateLoaded);
gst_omx_port_deallocate_buffers (self->dec_in_port);
gst_omx_video_dec_deallocate_output_buffers (self);
- if (state > OMX_StateLoaded)
- gst_omx_component_get_state (self->dec, 5 * GST_SECOND);
+ if (state > OMX_StateLoaded) {
+ 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;