[vlc-devel] [PATCH] es_out: drain decoders on GET_EMPTY

Francois Cartegnie fcvlcdev at free.fr
Wed Jun 7 01:48:41 CEST 2017


GET_EMPTY never returns true for some codecs in a state
requiring more data.
Seems the block flag END_OF_SEQUENCE was used to trigger
a drain, but has never been correctly handled (and
recently removed by me!).

Draining the decoders makes sure we do not rely on the
proper implementation of a block flag, but only on
draining which is now done for every decoder I think.

Solves freezes (or black screen in case of single keyframe)
on dvd/bluray menus loops.
---
 src/input/es_out.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index cde10de..3c31f90 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -2618,6 +2618,11 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
     case ES_OUT_GET_EMPTY:
     {
         bool *pb = va_arg( args, bool* );
+        for (int i = 0; i < p_sys->i_es; i++) {
+            es_out_id_t *id = p_sys->es[i];
+            if (id->p_dec != NULL)
+                input_DecoderDrain(id->p_dec);
+        }
         *pb = EsOutDecodersIsEmpty( out );
         return VLC_SUCCESS;
     }
-- 
2.9.4



More information about the vlc-devel mailing list