[vlc-commits] omxil: Avoid a SetParameters call that fails for audio codecs on Galaxy S II

Martin Storsjö git at videolan.org
Mon Dec 19 21:54:07 CET 2011


vlc | branch: master | Martin Storsjö <martin at martin.st> | Mon Dec 19 17:03:02 2011 +0200| [32f03862749167b62c05c0b228911ab4e2ae1d5f] | committer: Jean-Baptiste Kempf

omxil: Avoid a SetParameters call that fails for audio codecs on Galaxy S II

This SetParameters call shouldn't be necessary as far as I know,
but only avoiding it for audio codecs for now.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=32f03862749167b62c05c0b228911ab4e2ae1d5f
---

 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);



More information about the vlc-commits mailing list