[vlc-devel] [PATCH 4/5] omxil: Don't require SetAudioParameters on the decoder output port to succeed

Martin Storsjö martin at martin.st
Fri Feb 1 13:10:57 CET 2013


It's mostly enough to call it on the input port, while we later get
back what the decoder itself set on the output port (based on the
input port and codec config data), so if this fails, just ignore it.

This is required for using google SW audio codecs via OMX, which is
useful mostly for testing. (Using them still requires a few more
hacks though.)
---
 modules/codec/omxil/omxil.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index ba73f04..c15197a 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -418,8 +418,14 @@ static OMX_ERRORTYPE SetPortDefinition(decoder_t *p_dec, OmxPort *p_port,
                                        p_fmt->i_bitrate,
                                        p_fmt->audio.i_bitspersample,
                                        p_fmt->audio.i_blockalign);
-        CHECK_ERROR(omx_error, "SetAudioParameters failed (%x : %s)",
-                    omx_error, ErrorToString(omx_error));
+        if (def->eDir == OMX_DirInput) {
+            CHECK_ERROR(omx_error, "SetAudioParameters failed (%x : %s)",
+                        omx_error, ErrorToString(omx_error));
+        } else {
+            msg_Warn(p_dec, "SetAudioParameters failed (%x : %s) on output port",
+                     omx_error, ErrorToString(omx_error));
+            omx_error = OMX_ErrorNone;
+        }
     }
     if (!strcmp(p_dec->p_sys->psz_component, "OMX.TI.DUCATI1.VIDEO.DECODER") &&
                 def->eDir == OMX_DirOutput)
-- 
1.7.10.4




More information about the vlc-devel mailing list