[vlc-devel] [PATCH] filter: don't create blending filters for fake fmt

Steve Lhomme robux4 at videolabs.io
Tue Apr 28 08:45:01 CEST 2015


On Thu, Apr 23, 2015 at 9:06 AM, Thomas Guillem <thomas at gllm.fr> wrote:
> Since we know the filter configure will fail.
> ---
>  src/misc/filter.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/src/misc/filter.c b/src/misc/filter.c
> index 36f1ba4..fd2f362 100644
> --- a/src/misc/filter.c
> +++ b/src/misc/filter.c
> @@ -33,7 +33,17 @@
>  filter_t *filter_NewBlend( vlc_object_t *p_this,
>                             const video_format_t *p_dst_chroma )
>  {
> -    filter_t *p_blend = vlc_custom_create( p_this, sizeof(*p_blend), "blend" );
> +    filter_t *p_blend;
> +    const vlc_chroma_description_t *p_desc;
> +
> +    p_desc = vlc_fourcc_GetChromaDescription( p_dst_chroma->i_chroma );
> +    if( !p_desc || p_desc->plane_count == 0 )
> +    {
> +        msg_Err( p_this, "Could not create blending filter for fake fmt" );
> +        return NULL;
> +    }
> +
> +    p_blend = vlc_custom_create( p_this, sizeof(*p_blend), "blend" );
>      if( !p_blend )
>          return NULL;

This effectively fix the early blending being applied to DXVA2
surfaces. After that D3D11 and DirectDraw work fine with DXVA2
activated.

Maybe the whole early/late blending decision could be made better but
I think it's an okay fix for now. It will break if we add other
blending plugins though. I was considering making one to blend
directly into a D3D9 surface... So that would not be possible.



More information about the vlc-devel mailing list