diff mbox series

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

Message ID 20211023081257.28248-1-michael@niedermayer.cc
State Accepted
Commit 5f3a160b422e87e17d8fcd3aea51d478d0f05ba5
Headers show
Series [FFmpeg-devel,1/2] swscale/utils: Improve return codes of sws_setColorspaceDetails() | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Michael Niedermayer Oct. 23, 2021, 8:12 a.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libswscale/utils.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 3752c3ec38c..c726922527b 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 (c->cascaded_context[0] && memcmp(c->dstColorspaceTable, c->srcColorspaceTable, sizeof(int) * 4))
+            return -1; //AVERROR_PATCHWELCOME;
+        return 0;
     }
 
     if (!isYUV(c->dstFormat) && !isGray(c->dstFormat)) {