1
0
Fork 0

swscale: make sws_getCachedContext properly handle pre-processed formats

This commit is contained in:
Hendrik Leppkes 2013-05-09 20:22:26 +02:00
parent 6830266861
commit 0a520ddae8
Signed by: hendrik
GPG Key ID: 846079A4B0A7C1B5
1 changed files with 16 additions and 2 deletions

View File

@ -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,
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)
param = default_param;
if (context &&
(context->srcW != srcW ||
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->dstH != dstH ||
context->dstFormat != dstFormat ||
context->dstFormat != dstFormatHandled ||
context->dstRange != dst_range ||
context->dstXYZ != dst_xyz ||
context->dst0Alpha != dst_0alpha ||
context->flags != flags ||
context->param[0] != param[0] ||
context->param[1] != param[1])) {