[vlc-devel] [RFC PATCH] decoder: fix a "restart module" regression

Thomas Guillem thomas at gllm.fr
Wed Sep 16 17:44:02 CEST 2015


In a previous commit, when a module is restarted, I decided to drain the module
by calling DecoderDecodeAudio( p_dec, NULL ) or DecoderDecodeVideo( p_dec, NULL
).

There is an issue with mpeg_audio: pf_decode will return a block, and
aout_update_format will try to create an aout with a zeroed fmt_out, it will
fail and p_dec->b_error will be true.

There is a lot of way to fix this issue:

 1/ reset b_error to false when restarting a module.

 2/ Don't call DecoderDecodeAudio( p_dec, NULL ) or DecoderDecodeVideo( p_dec,
    NULL ) if there is no previous block decoded.

 3/ fix each modules to not return a invalid block when drained.

I would go for 1 and 3.
---
 src/input/decoder.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index c64a515..dc2cd84 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -187,6 +187,7 @@ static void UnloadDecoder( decoder_t *p_dec )
 
     es_format_Clean( &p_dec->fmt_in );
     es_format_Clean( &p_dec->fmt_out );
+    p_dec->b_error = false;
 }
 
 static void DecoderUpdateFormatLocked( decoder_t *p_dec )
-- 
2.1.4



More information about the vlc-devel mailing list