[vlc-devel] [PATCH 3/3] demux: adaptive: avoid send blocks with invalid DTS out of order

Zhao Zhili quinkblack at foxmail.com
Thu Aug 31 15:37:09 CEST 2017



On 2017年08月31日 17:50, Francois Cartegnie wrote:
> Le 31/08/2017 à 08:50, Zhao Zhili a écrit :
>> ---
>>   modules/demux/adaptive/plumbing/CommandsQueue.cpp | 28
>> +++++++++++++++++++++--
>>   1 file changed, 26 insertions(+), 2 deletions(-)
>>
>> diff --git a/modules/demux/adaptive/plumbing/CommandsQueue.cpp
>> b/modules/demux/adaptive/plumbing/CommandsQueue.cpp
>> index f2a48b6..8d82578 100644
>> --- a/modules/demux/adaptive/plumbing/CommandsQueue.cpp
>> +++ b/modules/demux/adaptive/plumbing/CommandsQueue.cpp
>> @@ -306,10 +306,34 @@ mtime_t CommandsQueue::Process( es_out_t *out,
>> mtime_t barrier )
>>           in.pop_front();
>>           b_datasent = true;
>>
>> -        if( command->getType() == ES_OUT_PRIVATE_COMMAND_SEND &&
>> command->getTime() > barrier )
>> -            commands.push_back( command );
>> +        if( command->getType() == ES_OUT_PRIVATE_COMMAND_SEND )
>> +        {
>> +            if( command->getTime() == VLC_TS_INVALID )
>> +            {
>> +                if( commands.empty() )
>> +                {
>> +                    output.push_back( command );
>> +                }
>> +                else
>> +                {
>> +                    // TODO: break out only if commands include items
>> with the same es id
>> +                    commands.push_back( command );
>> +                    break;
>> +                }
> I don't see what you're trying to solve here,
> but everything before PCR should be output if there's no timestamp.
> The bug is not in that code, but on the one sending timestamps, if any.
>

For example, B3 is a block with invalid timestamps, it should not be output
if B2 is not output, otherwise decoder cannot handle a block with invalid
timestamps and arrive out of order.

A0, A1, B1, A2, B2, B3(invalid), A3, B4

This patch will break bad interleaved streams with invalid timestamps, but
it's broken already. It should be improved to not block the output of other
streams, for example the A3.





More information about the vlc-devel mailing list