[vlc-devel] [PATCH] Don't blindly set the input buffer size

Martin Storsjö martin at martin.st
Tue Aug 28 16:07:47 CEST 2012


Keep it set to whatever the codec had set it to initially.

This makes the IOMX codecs work on Nexus 7.

This might also help for issues on Qualcomm devices (buffer sizes
that were too large on Nexus One, but restricting them broke
larger resolutions on HP TouchBook instead).

Optionally, one might need to call OMX_SetParameter/OMX_GetParameter
after setting the width/height to get a proper buffer size initialized
instead.
---
This is kind of an RFC patch - please test and let me know whether it
helps or makes things worse.

 modules/codec/omxil/omxil.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index bd3962d..3e44fb2 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -318,8 +318,9 @@ static OMX_ERRORTYPE SetPortDefinition(decoder_t *p_dec, OmxPort *p_port,
 
         if(def->eDir == OMX_DirInput || p_dec->p_sys->b_enc)
         {
-            def->nBufferSize = def->format.video.nFrameWidth *
-              def->format.video.nFrameHeight * 2;
+            if (def->eDir == OMX_DirInput && p_dec->p_sys->b_enc)
+                def->nBufferSize = def->format.video.nFrameWidth *
+                  def->format.video.nFrameHeight * 2;
             p_port->i_frame_size = def->nBufferSize;
 
             if(!GetOmxVideoFormat(p_fmt->i_codec,
-- 
1.7.10




More information about the vlc-devel mailing list