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

Alexandre Janniaux ajanni at videolabs.io
Wed Oct 7 16:02:27 CEST 2020


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.

> ---
>  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


More information about the vlc-devel mailing list