[vlc-devel] [PATCH 2/2] aout: don't play empty buffers

Thomas Guillem thomas at gllm.fr
Tue Feb 12 10:02:31 CET 2019


Other possible fix: put an assert and fix the filters that send empty blocks.
---
 src/audio_output/dec.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index b913ac18a0..e5aff4f691 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -370,6 +370,11 @@ int aout_DecPlay(audio_output_t *aout, block_t *block)
     block = aout_FiltersPlay(owner->filters, block, owner->sync.rate);
     if (block == NULL)
         goto lost;
+    else if (unlikely(block->i_buffer == 0))
+    {
+        block_Release(block);
+        return ret;
+    }
 
     /* Software volume */
     aout_volume_Amplify (owner->volume, block);
-- 
2.20.1



More information about the vlc-devel mailing list