swscale/utils: Forward luma range to the cascaded context for alphablending
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 10 Sep 2015 15:03:11 +0000 (17:03 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 10 Sep 2015 15:05:20 +0000 (17:05 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libswscale/utils.c

index 450d0d5..5265157 100644 (file)
@@ -1500,11 +1500,18 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
             if (ret < 0)
                 return ret;
 
-            c->cascaded_context[1] = sws_getContext(srcW, srcH, tmpFormat,
-                                                    dstW, dstH, dstFormat,
-                                                    flags, srcFilter, dstFilter, c->param);
+            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;
         }
     }