swscale: make sws_getCachedContext properly handle pre-processed formats
This commit is contained in:
parent
0710962a3a
commit
5d0527a6ab
|
@ -2510,16 +2510,30 @@ struct SwsContext *sws_getCachedContext(struct SwsContext *context, int srcW,
|
||||||
int64_t src_h_chr_pos = -513, dst_h_chr_pos = -513,
|
int64_t src_h_chr_pos = -513, dst_h_chr_pos = -513,
|
||||||
src_v_chr_pos = -513, dst_v_chr_pos = -513;
|
src_v_chr_pos = -513, dst_v_chr_pos = -513;
|
||||||
|
|
||||||
|
enum AVPixelFormat srcFormatHandled = srcFormat, dstFormatHandled = dstFormat;
|
||||||
|
int src_range = handle_jpeg(&srcFormatHandled);
|
||||||
|
int src_xyz = handle_xyz(&srcFormatHandled);
|
||||||
|
int src_0alpha = handle_0alpha(&srcFormatHandled);
|
||||||
|
int dst_range = handle_jpeg(&dstFormatHandled);
|
||||||
|
int dst_xyz = handle_xyz(&dstFormatHandled);
|
||||||
|
int dst_0alpha = handle_0alpha(&dstFormatHandled);
|
||||||
|
|
||||||
if (!param)
|
if (!param)
|
||||||
param = default_param;
|
param = default_param;
|
||||||
|
|
||||||
if (context &&
|
if (context &&
|
||||||
(context->srcW != srcW ||
|
(context->srcW != srcW ||
|
||||||
context->srcH != srcH ||
|
context->srcH != srcH ||
|
||||||
context->srcFormat != srcFormat ||
|
context->srcFormat != srcFormatHandled ||
|
||||||
|
context->srcRange != src_range ||
|
||||||
|
context->srcXYZ != src_xyz ||
|
||||||
|
context->src0Alpha != src_0alpha ||
|
||||||
context->dstW != dstW ||
|
context->dstW != dstW ||
|
||||||
context->dstH != dstH ||
|
context->dstH != dstH ||
|
||||||
context->dstFormat != dstFormat ||
|
context->dstFormat != dstFormatHandled ||
|
||||||
|
context->dstRange != dst_range ||
|
||||||
|
context->dstXYZ != dst_xyz ||
|
||||||
|
context->dst0Alpha != dst_0alpha ||
|
||||||
context->flags != flags ||
|
context->flags != flags ||
|
||||||
context->param[0] != param[0] ||
|
context->param[0] != param[0] ||
|
||||||
context->param[1] != param[1])) {
|
context->param[1] != param[1])) {
|
||||||
|
|
Loading…
Reference in New Issue