Memleak on restarting ES
There's a memleak when restarting ES (ex with ogg streams):
==14801==
==14801== 304 bytes in 1 blocks are definitely lost in loss record 77 of 123
==14801== at 0x4A0887C: malloc (vg_replace_malloc.c:270)
==14801== by 0x4EABB99: block_Alloc (block.c:139)
==14801== by 0x4E67DCA: DecoderBlockFlushNew (decoder.c:953)
==14801== by 0x4E6B742: DecoderFlush (decoder.c:979)
==14801== by 0x4E6BDB3: input_DecoderStartBuffering (decoder.c:552)
==14801== by 0x4E6E3EF: EsCreateDecoder (es_out.c:1561)
==14801== by 0x4E72BBC: EsOutControl (es_out.c:2393)
==14801== by 0x4E74B6B: es_out_Control (vlc_es_out.h:126)
==14801== by 0x4E76B6D: Control (es_out_timeshift.c:620)
==14801== by 0x13DB151B: es_out_Control (vlc_es_out.h:126)
==14801== by 0x13DBDE67: Demux (ogg.c:318)
==14801== by 0x4E7D7A7: MainLoop (demux.h:44)
The "flush" flagged buffer doesn't get freed(), and is generated because the ES is flagged as buffering. Before restart (Disable/EnableDecoder), demux hasn't started sending data to decoders yet.
Wrong patch, but no longer leaks.
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 68acf5e..b728683 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -1578,6 +1578,7 @@ static void EsDestroyDecoder( es_out_t *out, es_out_id_t *p_es )
return;
input_DecoderDelete( p_es->p_dec );
+ out->p_sys->b_buffering = false;
p_es->p_dec = NULL;
if( p_es->p_dec_record )
Unsure what to do.