[vlc-devel] [PATCH] filters: assert if converters output more than one picture at once

Rémi Denis-Courmont remi at remlab.net
Thu Oct 15 17:42:33 CEST 2020


Nit: the description makes no sense in English.

It's either "abort if converters output more than one picture at once"
or "assert that converters output no more than one picture at once".

Le torstaina 15. lokakuuta 2020, 17.09.10 EEST Steve Lhomme a écrit :
> ---
>  modules/video_filter/ci_filters.m   | 2 ++
>  src/misc/image.c                    | 6 +++++-
>  src/video_output/vout_subpictures.c | 2 ++
>  3 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/modules/video_filter/ci_filters.m
> b/modules/video_filter/ci_filters.m index e712ad6ac39..21f0e18cd4b 100644
> --- a/modules/video_filter/ci_filters.m
> +++ b/modules/video_filter/ci_filters.m
> @@ -380,6 +380,7 @@ Filter(filter_t *filter, picture_t *src)
>          src = ctx->src_converter->ops->filter_video(ctx->src_converter,
> src); if (!src)
>              return NULL;
> +        assert(!picture_HasChainedPics(src)); // no chaining
>      }
> 
>      @autoreleasepool {
> @@ -420,6 +421,7 @@ Filter(filter_t *filter, picture_t *src)
>          dst = ctx->dst_converter->ops->filter_video(ctx->dst_converter,
> dst); if (!dst)
>              return NULL;
> +        assert(!picture_HasChainedPics(dst)); // no chaining
>      }
> 
>      p_sys->mouse_moved = false;
> diff --git a/src/misc/image.c b/src/misc/image.c
> index 5ba958fd406..034b0a27d8e 100644
> --- a/src/misc/image.c
> +++ b/src/misc/image.c
> @@ -271,6 +271,7 @@ static picture_t *ImageRead( image_handler_t *p_image,
> block_t *p_block, }
> 
>          p_pic = p_image->p_converter->ops->filter_video(
> p_image->p_converter, p_pic ); +        assert(p_pic == NULL ||
> !picture_HasChainedPics(p_pic)); // no chaining }
>      else
>      {
> @@ -438,6 +439,7 @@ static block_t *ImageWrite( image_handler_t *p_image,
> picture_t *p_pic,
> 
>          if( likely(p_tmp_pic != NULL) )
>          {
> +            assert(!picture_HasChainedPics(p_tmp_pic)); // no chaining
>              p_block = p_image->p_enc->pf_encode_video( p_image->p_enc,
>                                                         p_tmp_pic );
>              picture_Release( p_tmp_pic );
> @@ -569,7 +571,9 @@ static picture_t *ImageConvert( image_handler_t
> *p_image, picture_t *p_pic,
> 
>      picture_Hold( p_pic );
> 
> -    return p_image->p_converter->ops->filter_video( p_image->p_converter,
> p_pic ); +    p_pic = p_image->p_converter->ops->filter_video(
> p_image->p_converter, p_pic ); +    assert(p_pic == NULL ||
> !picture_HasChainedPics(p_pic)); // no chaining +    return p_pic;
>  }
> 
>  /**
> diff --git a/src/video_output/vout_subpictures.c
> b/src/video_output/vout_subpictures.c index 0d254b2c556..f60c6f57973 100644
> --- a/src/video_output/vout_subpictures.c
> +++ b/src/video_output/vout_subpictures.c
> @@ -1002,6 +1002,7 @@ static void SpuRenderRegion(spu_t *spu,
>                  scale_yuvp->fmt_out.video.i_chroma = chroma_list[0];
> 
>                  picture = scale_yuvp->ops->filter_video(scale_yuvp,
> picture); +                assert(picture == NULL ||
> !picture_HasChainedPics(picture)); // no chaining if (!picture) {
>                      /* Well we will try conversion+scaling */
>                      msg_Warn(spu, "%4.4s to %4.4s conversion failed",
> @@ -1033,6 +1034,7 @@ static void SpuRenderRegion(spu_t *spu,
>                      spu_scale_h(region->fmt.i_visible_height, scale_size);
> 
>                  picture = scale->ops->filter_video(scale, picture);
> +                assert(picture == NULL ||
> !picture_HasChainedPics(picture)); // no chaining if (!picture)
>                      msg_Err(spu, "scaling failed");
>              }


-- 
Rémi Denis-Courmont
http://www.remlab.net/





More information about the vlc-devel mailing list