]> git.sesse.net Git - vlc/commitdiff
OMX: Don't blindly set the input buffer size
authorMartin Storsjö <martin@martin.st>
Tue, 28 Aug 2012 14:07:47 +0000 (17:07 +0300)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 28 Aug 2012 15:55:08 +0000 (17:55 +0200)
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.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/codec/omxil/omxil.c

index bd3962dca936d8c532969b97e2423036306f45dc..3e44fb23cf638beeb7ab22d2b716f34e3f0477e0 100644 (file)
@@ -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,