[vlc-devel] [PATCH 2/3] transcode: video: don't drain the secondary filters

Steve Lhomme robux4 at ycbcr.xyz
Wed Oct 7 16:19:19 CEST 2020


On 2020-10-07 16:02, Alexandre Janniaux wrote:
> Hi,
> 
> On Wed, Oct 07, 2020 at 02:02:26PM +0200, Steve Lhomme wrote:
>> The second loop is never looping since on the second call p_in is NULL,
>> resulting in the "secondary_chains" loop not being used and thus p_in remains
>> NULL.
>>
>> Most filters can't handle a NULL input anyway so it could potentially crash.
> 
> filter_chain_VideoFilter does not directly call pf_filter.
> drain is not handled by the filter but by the filter chain.

Indeed, passing NULL to the "secondary" filter_chain_VideoFilter would 
effectively drain the filter chain, regardless of the filters themselves.

On the other hand the filters in p_uf_chain (user) and 
p_final_conv_static (last converter) shouldn't produce more than one 
picture per output. The only filters that produce more than one input 
are deinterlacers and "fps" (which is automatically added to p_f_chain 
in this case).

In the end with proper draining of each filter chain, regardless of 
their nature, should fix this. So I'll on to this patch(set) for now.

>> ---
>>   modules/stream_out/transcode/video.c | 3 ---
>>   1 file changed, 3 deletions(-)
>>
>> diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
>> index e699a558145..144856fb79a 100644
>> --- a/modules/stream_out/transcode/video.c
>> +++ b/modules/stream_out/transcode/video.c
>> @@ -596,8 +596,6 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
>>               if( !p_in )
>>                   break;
>>
>> -            for ( ;; p_in = NULL /* drain second time */ )
>> -            {
>>                   /* Run user specified filter chain */
>>                   filter_chain_t * secondary_chains[] = { id->p_uf_chain,
>>                                                           id->p_final_conv_static };
>> @@ -612,7 +610,6 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
>>                       break;
>>
>>                   encode_filtered( id, out, p_in );
>> -            }
>>           }
>>
>>           if( b_eos )
>> --
>> 2.26.2
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> 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