[vlc-devel] [PATCH 4/9] mmal/codec: flush: wait for input buffers

Julian Scheel julian at jusst.de
Thu Oct 19 11:23:01 CEST 2017


Wait for all input buffers to be returned when flushing.

Signed-off-by: Julian Scheel <julian at jusst.de>
---
 modules/hw/mmal/codec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/hw/mmal/codec.c b/modules/hw/mmal/codec.c
index 884da3a409..cdd765d86e 100644
--- a/modules/hw/mmal/codec.c
+++ b/modules/hw/mmal/codec.c
@@ -540,7 +540,8 @@ static void flush_decoder(decoder_t *dec)
     mmal_port_flush(sys->output);
     mmal_port_flush(sys->input);
 
-    while (atomic_load(&sys->output_in_transit))
+    while (atomic_load(&sys->output_in_transit) ||
+		    atomic_load(&sys->input_in_transit))
         vlc_sem_wait(&sys->sem);
 
     /* Free pictures which are decoded but have not yet been sent
-- 
2.14.2



More information about the vlc-devel mailing list