[vlc-devel] [PATCH 1/3] packetizer:copy: handle the BLOCK_FLAG_DISCONTINUITY

Steve Lhomme robux4 at gmail.com
Tue Nov 17 11:25:22 CET 2015


On Tue, Nov 17, 2015 at 10:20 AM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> You seem to confuse discontinuity and flush. C.f. recent discussions.

There's not really a flag for that. There is BLOCK_FLAG_CORE_FLUSH but
it's internal to the core.

The common function packetizer_Packetize() already flushes when
encountering BLOCK_FLAG_DISCONTINUITY or BLOCK_FLAG_CORRUPTED.

Adding a flush function to the packetizer may be overkill (it's a
decoder_t). Maybe we can make BLOCK_FLAG_CORE_FLUSH public and handle
the difference of treatment compared to a discontinuity ?

Maybe we should also clean DecoderBlockFlushNew() which pushes all 3
flags downstream when only a flush should happen. That means going
through all decoders and also handle the new FLUSH flag. Likely the
same as a discontinuity for now (that's how it's currently done) and
we can refine later.

> Le 2015-11-17 12:18, Steve Lhomme a écrit :
>>
>> ---
>>  modules/packetizer/copy.c | 12 +++++++++++-
>>  1 file changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/modules/packetizer/copy.c b/modules/packetizer/copy.c
>> index bc3a623..5882beb 100644
>> --- a/modules/packetizer/copy.c
>> +++ b/modules/packetizer/copy.c
>> @@ -144,6 +144,16 @@ static block_t *Packetize ( decoder_t *p_dec,
>> block_t **pp_block )
>>
>>      if( pp_block == NULL || *pp_block == NULL )
>>          return NULL;
>> +
>> +    if( (*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY) )
>> +    {
>> +        if (p_ret != NULL)
>> +        {
>> +            block_ChainRelease( p_ret );
>> +            p_ret = NULL;
>> +            p_dec->p_sys->p_block = NULL;
>> +        }
>> +    }
>>      if( (*pp_block)->i_flags&(BLOCK_FLAG_CORRUPTED) )
>>      {
>>          block_Release( *pp_block );
>> @@ -186,7 +196,7 @@ static block_t *PacketizeSub( decoder_t *p_dec,
>> block_t **pp_block )
>>
>>      if( pp_block == NULL || *pp_block == NULL )
>>          return NULL;
>> -    if( (*pp_block)->i_flags&(BLOCK_FLAG_CORRUPTED) )
>> +    if(
>> (*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
>>      {
>>          block_Release( *pp_block );
>>          return NULL;
>
>
> --
> Rémi Denis-Courmont
> http://www.remlab.net/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list