diff options
author | Limin Wang <lance.lmwang@gmail.com> | 2020-06-13 07:29:43 +0800 |
---|---|---|
committer | Limin Wang <lance.lmwang@gmail.com> | 2020-06-14 21:54:40 +0800 |
commit | 8efecc9063fd89184a51381074e5a6e6564e0608 (patch) | |
tree | 9fb3c86af58bd35f858dfbd6f3125ad22206af78 /libswscale | |
parent | ffc1208266c2890a1b0e2391e0a536fe9698e69c (diff) | |
download | ffmpeg-8efecc9063fd89184a51381074e5a6e6564e0608.tar.gz |
swscale/utils: reindent
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/utils.c | 71 |
1 files changed, 36 insertions, 35 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c index ff99e79e0a..6e218ba067 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1575,41 +1575,42 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, if (CONFIG_SWSCALE_ALPHA && isALPHA(srcFormat) && !isALPHA(dstFormat)) { enum AVPixelFormat tmpFormat = alphaless_fmt(srcFormat); - if (tmpFormat != AV_PIX_FMT_NONE && c->alphablend != SWS_ALPHA_BLEND_NONE) - if (!unscaled || - dstFormat != tmpFormat || - usesHFilter || usesVFilter || - c->srcRange != c->dstRange - ) { - c->cascaded_mainindex = 1; - ret = av_image_alloc(c->cascaded_tmp, c->cascaded_tmpStride, - srcW, srcH, tmpFormat, 64); - if (ret < 0) - return ret; - - c->cascaded_context[0] = sws_alloc_set_opts(srcW, srcH, srcFormat, - srcW, srcH, tmpFormat, - flags, c->param); - if (!c->cascaded_context[0]) - return -1; - c->cascaded_context[0]->alphablend = c->alphablend; - ret = sws_init_context(c->cascaded_context[0], NULL , NULL); - if (ret < 0) - return ret; - - c->cascaded_context[1] = sws_alloc_set_opts(srcW, srcH, tmpFormat, - dstW, dstH, dstFormat, - flags, c->param); - if (!c->cascaded_context[1]) - return -1; - - c->cascaded_context[1]->srcRange = c->srcRange; - c->cascaded_context[1]->dstRange = c->dstRange; - ret = sws_init_context(c->cascaded_context[1], srcFilter , dstFilter); - if (ret < 0) - return ret; - - return 0; + if (tmpFormat != AV_PIX_FMT_NONE && c->alphablend != SWS_ALPHA_BLEND_NONE) { + if (!unscaled || + dstFormat != tmpFormat || + usesHFilter || usesVFilter || + c->srcRange != c->dstRange + ) { + c->cascaded_mainindex = 1; + ret = av_image_alloc(c->cascaded_tmp, c->cascaded_tmpStride, + srcW, srcH, tmpFormat, 64); + if (ret < 0) + return ret; + + c->cascaded_context[0] = sws_alloc_set_opts(srcW, srcH, srcFormat, + srcW, srcH, tmpFormat, + flags, c->param); + if (!c->cascaded_context[0]) + return -1; + c->cascaded_context[0]->alphablend = c->alphablend; + ret = sws_init_context(c->cascaded_context[0], NULL , NULL); + if (ret < 0) + return ret; + + c->cascaded_context[1] = sws_alloc_set_opts(srcW, srcH, tmpFormat, + dstW, dstH, dstFormat, + flags, c->param); + if (!c->cascaded_context[1]) + return -1; + + c->cascaded_context[1]->srcRange = c->srcRange; + c->cascaded_context[1]->dstRange = c->dstRange; + ret = sws_init_context(c->cascaded_context[1], srcFilter , dstFilter); + if (ret < 0) + return ret; + + return 0; + } } } |