[FFmpeg-devel] [PATCH 2/2] swscale/utils: Improve return codes of sws_setColorspaceDetails()

James Almer jamrial at gmail.com
Sat Oct 23 04:55:25 EEST 2021


On 10/22/2021 6:45 PM, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>   libswscale/utils.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/libswscale/utils.c b/libswscale/utils.c
> index 3752c3ec38c..632f6fd4648 100644
> --- a/libswscale/utils.c
> +++ b/libswscale/utils.c
> @@ -995,7 +995,10 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
>                                        0, 1 << 16, 1 << 16);
>               return 0;
>           }
> -        return -1;
> +        //We do not support this combination currently, we need to cascade more contexts to compensate
> +        if (memcmp(c->dstColorspaceTable, c->srcColorspaceTable, sizeof(int) * 4))
> +            return AVERROR_PATCHWELCOME;

The doxy does not allow return values other than -1.

> +        return 0;
>       }
>   
>       if (!isYUV(c->dstFormat) && !isGray(c->dstFormat)) {
> 



More information about the ffmpeg-devel mailing list