[vlc-devel] [PATCH 4/6] omxil: Avoid a SetParameters call that fails for audio codecs on Galaxy S II

Martin Storsjö martin at martin.st
Mon Dec 19 16:03:02 CET 2011


This SetParameters call shouldn't be necessary as far as I know,
but only avoiding it for audio codecs for now.
---
 modules/codec/omxil/omxil.c |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index 763a35e..92f2be7 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -1062,10 +1062,25 @@ static OMX_ERRORTYPE PortReconfigure(decoder_t *p_dec, OmxPort *p_port)
     /* Get the new port definition */
     omx_error = GetPortDefinition(p_dec, &p_sys->out, p_sys->out.p_fmt);
     if(omx_error != OMX_ErrorNone) goto error;
-    omx_error = OMX_SetParameter(p_dec->p_sys->omx_handle, OMX_IndexParamPortDefinition,
-                                 &definition);
-    CHECK_ERROR(omx_error, "OMX_SetParameter failed (%x : %s)",
-                omx_error, ErrorToString(omx_error));
+
+    if( p_dec->fmt_in.i_cat != AUDIO_ES )
+    {
+        /* Don't explicitly set the new parameters that we got with
+         * OMX_GetParameter above when using audio codecs.
+         * That struct hasn't been changed since, so there should be
+         * no need to set it here, unless some codec expects the
+         * SetParameter call as a trigger event for some part of
+         * the reconfiguration.
+         * This fixes using audio decoders on Samsung Galaxy S II,
+         *
+         * Only skipping this for audio codecs, to minimize the
+         * change for current working configurations for video.
+         */
+        omx_error = OMX_SetParameter(p_dec->p_sys->omx_handle, OMX_IndexParamPortDefinition,
+                                     &definition);
+        CHECK_ERROR(omx_error, "OMX_SetParameter failed (%x : %s)",
+                    omx_error, ErrorToString(omx_error));
+    }
 
     omx_error = OMX_SendCommand( p_sys->omx_handle, OMX_CommandPortEnable,
                                  p_port->i_port_index, NULL);
-- 
1.7.2.5




More information about the vlc-devel mailing list