Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-08-31 01:34:55 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-08-31 03:00:55 +0300
commit1acd6311a100859f3ef4119790da9d5cb5546979 (patch)
tree0903418663ae6bb7a0d28476fbdc145a211a9253 /libswscale
parent8e05f9217ae567a26ea71dd29acd79b1631ae593 (diff)
swscale/utils: If cascaded contexts are used forward sws_setColorspaceDetails() to the first context
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/utils.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 53f68db1b3..4664de42e3 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -855,6 +855,12 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
if (need_reinit && (c->srcBpc == 8 || !isYUV(c->srcFormat)))
ff_sws_init_range_convert(c);
+ c->dstFormatBpp = av_get_bits_per_pixel(desc_dst);
+ c->srcFormatBpp = av_get_bits_per_pixel(desc_src);
+
+ if (c->cascaded_context[0])
+ return sws_setColorspaceDetails(c->cascaded_context[0],inv_table, srcRange,table, dstRange, brightness, contrast, saturation);
+
if ((isYUV(c->dstFormat) || isGray(c->dstFormat)) && (isYUV(c->srcFormat) || isGray(c->srcFormat))) {
if (!c->cascaded_context[0] &&
memcmp(c->dstColorspaceTable, c->srcColorspaceTable, sizeof(int) * 4) &&
@@ -923,9 +929,6 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
return -1;
}
- c->dstFormatBpp = av_get_bits_per_pixel(desc_dst);
- c->srcFormatBpp = av_get_bits_per_pixel(desc_src);
-
if (!isYUV(c->dstFormat) && !isGray(c->dstFormat)) {
ff_yuv2rgb_c_init_tables(c, inv_table, srcRange, brightness,
contrast, saturation);