]> git.sesse.net Git - vlc/commitdiff
omxil: Only set the buffer size if it is smaller than what the codec suggested
authorMartin Storsjö <martin@martin.st>
Thu, 21 Jul 2011 11:06:07 +0000 (14:06 +0300)
committerRafaël Carré <funman@videolan.org>
Mon, 25 Jun 2012 19:26:25 +0000 (21:26 +0200)
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@videolan.org>
modules/codec/omxil/omxil.c

index 8608f0e422d42afbd407a811ec5e221c3acd5437..8e6ebf9a87dfb5caf4c85ab9a9af7b7d52349dc0 100644 (file)
@@ -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;