]> git.sesse.net Git - vlc/commitdiff
omxil: Make sure all the real buffers are freed
authorMartin Storsjö <martin@martin.st>
Thu, 12 Apr 2012 09:15:54 +0000 (12:15 +0300)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 13 Apr 2012 14:56:58 +0000 (16:56 +0200)
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@videolan.org>
modules/codec/omxil/omxil.c

index b57dc59b060212b6934bf18177b0e82ea7e82eca..9a9f8da3945e6992ac8a5848378c47f435042802 100644 (file)
@@ -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 );