diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-03-11 10:29:44 +0100 |
---|---|---|
committer | Josep Torra <n770galaxy@gmail.com> | 2013-03-11 11:41:16 +0100 |
commit | f7b05ae044643c8506acfcf35da1af5b62280f55 (patch) | |
tree | 96633208284440cffb1f7b8a0b23b42cf7ebb1d7 | |
parent | 03cae3ad062fc16300e9ca0a8eb0ec01ac144e55 (diff) |
omxaudioenc: Disable output port when setting a new format
-rw-r--r-- | omx/gstomxaudioenc.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/omx/gstomxaudioenc.c b/omx/gstomxaudioenc.c index 799b6d5..a5a4f8b 100644 --- a/omx/gstomxaudioenc.c +++ b/omx/gstomxaudioenc.c @@ -676,14 +676,24 @@ gst_omx_audio_enc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info) if (gst_omx_port_set_enabled (self->enc_in_port, FALSE) != OMX_ErrorNone) return FALSE; + if (gst_omx_port_set_enabled (self->enc_out_port, FALSE) != OMX_ErrorNone) + return FALSE; if (gst_omx_port_wait_buffers_released (self->enc_in_port, 5 * GST_SECOND) != OMX_ErrorNone) return FALSE; + if (gst_omx_port_wait_buffers_released (self->enc_out_port, + 1 * GST_SECOND) != OMX_ErrorNone) + return FALSE; if (gst_omx_port_deallocate_buffers (self->enc_in_port) != OMX_ErrorNone) return FALSE; + if (gst_omx_port_deallocate_buffers (self->enc_out_port) != OMX_ErrorNone) + return FALSE; if (gst_omx_port_wait_enabled (self->enc_in_port, 1 * GST_SECOND) != OMX_ErrorNone) return FALSE; + if (gst_omx_port_wait_enabled (self->enc_out_port, + 1 * GST_SECOND) != OMX_ErrorNone) + return FALSE; GST_DEBUG_OBJECT (self, "Encoder drained and disabled"); } @@ -813,11 +823,6 @@ gst_omx_audio_enc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info) gst_omx_port_set_flushing (self->enc_in_port, 5 * GST_SECOND, FALSE); gst_omx_port_set_flushing (self->enc_out_port, 5 * GST_SECOND, FALSE); - /* Populate outport with buffers if we any */ - if (!needs_disable) - if (gst_omx_port_populate (self->enc_out_port) != OMX_ErrorNone) - return FALSE; - if (gst_omx_component_get_last_error (self->enc) != OMX_ErrorNone) { GST_ERROR_OBJECT (self, "Component in error state: %s (0x%08x)", gst_omx_component_get_last_error_string (self->enc), |