[vlc-commits] omxil: Make sure all the real buffers are freed

Martin Storsjö git at videolan.org
Fri Apr 13 16:57:51 CEST 2012


vlc | branch: master | Martin Storsjö <martin at martin.st> | Thu Apr 12 12:15:54 2012 +0300| [8460c8d734c9762390ba11dbf615ef7290baf81d] | committer: Jean-Baptiste Kempf

omxil: Make sure all the real buffers are freed

If there's a sentinel buffer in the queue, don't count it,
but wait until the right number of buffers have been freed.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/omxil/omxil.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index b57dc59..9a9f8da 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -614,8 +614,10 @@ static OMX_ERRORTYPE DeinitialiseComponent(decoder_t *p_dec,
             for(j = 0; j < p_port->i_buffers; j++)
             {
                 OMX_FIFO_GET(&p_port->fifo, p_buffer);
-                if (p_buffer == &p_sys->sentinel_buffer)
+                if (p_buffer == &p_sys->sentinel_buffer) {
+                    j--;
                     continue;
+                }
                 omx_error = OMX_FreeBuffer( omx_handle,
                                             p_port->i_port_index, p_buffer );
 
@@ -1090,8 +1092,10 @@ static OMX_ERRORTYPE PortReconfigure(decoder_t *p_dec, OmxPort *p_port)
     for(i = 0; i < p_port->i_buffers; i++)
     {
         OMX_FIFO_GET(&p_port->fifo, p_buffer);
-        if (p_buffer == &p_sys->sentinel_buffer)
+        if (p_buffer == &p_sys->sentinel_buffer) {
+            i--;
             continue;
+        }
         omx_error = OMX_FreeBuffer( p_sys->omx_handle,
                                     p_port->i_port_index, p_buffer );
 



More information about the vlc-commits mailing list