[vlc-devel] [PATCH] input: decoder: fix audio GET_EMPTY mid stream

Rémi Denis-Courmont remi at remlab.net
Thu Jun 29 14:22:20 CEST 2017


Le 29 juin 2017 15:06:40 GMT+03:00, Jean-Baptiste Kempf <jb at videolan.org> a écrit :
>Not against, but that could would love to have some comment...
>
>On Wed, 28 Jun 2017, at 19:06, Francois Cartegnie wrote:
>> When the demuxer does not reach EOS, the decoders
>> are not drained and GET_EMPTY can't succeed for
>> audio as it is in idle/fifo wait state.
>> Note: The caller knows the fifo won't receive any
>> further data until GET_EMPTY succeeds.
>> 
>> refs #18463
>> ---
>>  src/input/decoder.c | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>> 
>> diff --git a/src/input/decoder.c b/src/input/decoder.c
>> index 0a96c04..73c7a29 100644
>> --- a/src/input/decoder.c
>> +++ b/src/input/decoder.c
>> @@ -2092,7 +2092,16 @@ bool input_DecoderIsEmpty( decoder_t * p_dec )
>>      if( p_owner->fmt.i_cat == VIDEO_ES && p_owner->p_vout != NULL )
>>          b_empty = vout_IsEmpty( p_owner->p_vout );
>>      else if( p_owner->fmt.i_cat == AUDIO_ES )
>> +    {
>>          b_empty = atomic_load( &p_owner->drained );
>> +        if( !b_empty )
>> +        {
>> +            vlc_fifo_Lock( p_owner->p_fifo );
>> +            if( !p_owner->b_draining )
>> +                b_empty |= vlc_fifo_IsEmpty( p_owner->p_fifo );
>> +            vlc_fifo_Unlock( p_owner->p_fifo );
>> +        }
>> +    }
>>      else
>>          b_empty = true; /* TODO subtitles support */
>>      vlc_mutex_unlock( &p_owner->lock );
>> -- 
>> 2.9.4
>> 
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>
>
>-- 
>Jean-Baptiste Kempf -  President
>+33 672 704 734
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

It is entirely possible that the FIFO is empty while audio is playing. In fact, this is very likely as audio outputs tend to have large playout buffers, such that the decoder FIFO is most often empty.

So this looks totally wrong.
-- 
Rémi Denis-Courmont
Typed on an inconvenient virtual keyboard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170629/d81cf0b4/attachment.html>


More information about the vlc-devel mailing list