[vlc-devel] [WIP/PATCH v2] Audio decoder: output buffered decoded frames on EOF

Rafaël Carré funman at videolan.org
Mon Oct 21 18:30:05 CEST 2013

Le 16/10/2013 23:50, Jean-Baptiste Kempf a écrit :
> On 16 Oct, Rafaël Carré wrote :
>> If EOF happens during buffering, the buffered frames will be flushed
>> and never played back.
>> This should only be visible for very short files such as:
>> http://streams.videolan.org/issues/9195/73ms-VLC-KO.wav
>> Note, pulse will lose the audio for such short files, alsa and afile work better
>> Closes: #3152
> I don't understand all this patch, tbh, but I feel that the comments are
> a bit short :)

I tried to write some comments already but honestly this is quite
complex as often with Laurent's code (he can understand some very
complex code interactions but for the rest of us it's hard to handle),
so I do not understand everything yet.

I will put more detailed comments when I understand more.

> But yes, it works for me. Call me impressed.

I had some deadlocks when seeking in DVDs so this is not complete yet as

This all comes from this part I suppose:

-        DecoderSignalBuffering( p_dec, p_block == NULL );
+        if (p_block == NULL || p_block->i_flags & BLOCK_FLAG_CORE_EOS) {
+            /* Stop buffering if we're at end of stream */

p_block == NULL and i_flags & BLOCK_FLAG_CORE_EOS have different
semantics which need to be handled differently.

Updated patch coming soon :)

More information about the vlc-devel mailing list