diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2013-05-09 22:22:26 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2017-08-04 20:12:12 +0300 |
commit | 9efeb07e70ea882416929c7e7e8d2185f5915e75 (patch) | |
tree | ae81cb58c8658b35be98992d987f346e95d2e953 /libswscale | |
parent | 408b2b4471abeb6a82aa73a46a4d5ceee04e8a2a (diff) |
swscale: make sws_getCachedContext properly handle pre-processed formats
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/utils.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c index 17c996734a..08db2df0b4 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -2346,16 +2346,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])) { |