]> git.sesse.net Git - vlc/commitdiff
omxil: Don't require SetAudioParameters on the decoder output port to succeed
authorMartin Storsjö <martin@martin.st>
Wed, 11 Apr 2012 16:25:36 +0000 (19:25 +0300)
committerMartin Storsjö <martin@martin.st>
Sat, 2 Feb 2013 13:59:01 +0000 (15:59 +0200)
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.)

Signed-off-by: Martin Storsjö <martin@martin.st>
modules/codec/omxil/omxil.c

index ba73f04e99f92d80c308d8a93b61f25694ffd9f9..c15197ac3dc62ee127c455b7feb21b88018c01d9 100644 (file)
@@ -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)