[vlc-devel] [PATCH] omxil: Limit input buffer size for qdsp6

Martin Storsjö martin at martin.st
Tue Oct 11 10:34:21 CEST 2011


From: Ming Hu <tewilove at gmail.com>

This fixes trac ticket 5393.
---

This is not nice, but needed with the current buffer size
allocation strategy in the omxil module.

Currently, input buffers are allocated as 2*width*height
bytes, which is too much for this decoder at high resolutions.

 modules/codec/omxil/omxil.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index 3bbf5a0..717a99a 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -264,6 +264,16 @@ static OMX_ERRORTYPE ImplementationSpecificWorkarounds(decoder_t *p_dec,
             def->format.video.xFramerate >>= 16;
         }
     }
+    else if (!strncmp(p_sys->psz_component, "OMX.qcom.video.decoder.",
+                      strlen("OMX.qcom.video.decoder")))
+    {
+        /* qdsp6 refuses buffer size larger than 450K on input port */
+        if (def->nBufferSize > 450 * 1024)
+        {
+            def->nBufferSize = 450 * 1024;
+            p_port->i_frame_size = def->nBufferSize;
+        }
+    }
 
     return OMX_ErrorNone;
 }
-- 
1.7.2.5




More information about the vlc-devel mailing list