swscale/utils: Improve return codes of sws_setColorspaceDetails()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2021-10-22 23:24:11 +02:00
parent c7699f95bb
commit 5f3a160b42
1 changed files with 4 additions and 1 deletions

View File

@ -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)) {