[vlc-commits] omxil: Only set the buffer size if it is smaller than what the codec suggested

Martin Storsjö git at videolan.org
Mon Jun 25 21:31:41 CEST 2012


vlc | branch: master | Martin Storsjö <martin at martin.st> | Thu Jul 21 14:06:07 2011 +0300| [3c9c56db0839dc2d564bbe8b02fbefe43c3dcbad] | committer: Rafaël Carré

omxil: Only set the buffer size if it is smaller than what the codec suggested

This is required on HTC Sensation. That device uses a special
tiled pixel format, which probably contains a bit of padding, too.
The size that the omx codec suggests for the output port is bigger
than what VLC calculates, and we thus should keep the larger value
instead of overwriting it with what we calculated ourselves.

Signed-off-by: Rafaël Carré <funman at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3c9c56db0839dc2d564bbe8b02fbefe43c3dcbad
---

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

diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index 8608f0e..8e6ebf9 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -352,7 +352,8 @@ static OMX_ERRORTYPE SetPortDefinition(decoder_t *p_dec, OmxPort *p_port,
                                &p_port->i_frame_size, &p_port->i_frame_stride,
                                &p_port->i_frame_stride_chroma_div );
             def->format.video.nStride = p_port->i_frame_stride;
-            def->nBufferSize = p_port->i_frame_size;
+            if (p_port->i_frame_size > def->nBufferSize)
+                def->nBufferSize = p_port->i_frame_size;
         }
         break;
 



More information about the vlc-commits mailing list