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

Zhao Zhili quinkblack at foxmail.com
Fri Sep 1 05:30:33 CEST 2017



On 2017年09月01日 01:09, Francois Cartegnie wrote:
> Le 31/08/2017 à 15:37, Zhao Zhili a écrit :
>
>> 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.
> You have no way yo tell if B3 is continuous data from B2. So without
> tracking, that's incomplete.
>

If there are tracks info in CommandsQueue, we can check:
                 if( commands not include track B )
                 {
                     output.push_back( command );
                 }
                 else
                 {
                     // or just break out
                     if ( time of B4 <= barrier )
                         output.push_back( command );
                     else
                         commands.push_back( command );
                 }

Without tracks info:

                 if( commands.empty() )
                 {
                     output.push_back( command );
                 }
                 else
                 {
                     commands.push_back( command );
                     break;
                 }

Output B3 only if commands.empty() is a strict condition to
make sure B3 is not output before B2. Push back B3 and
breakout is to make sure B4 is not output before B3.

It's possible to output blocks in the right order without tracks
info, but impossible to not block the output of other tracks.


More information about the vlc-devel mailing list