changeset 32338:5572e926e027

100l, fix sws_getCachedContext. It did not set the colorspace details, but worse it did not set up destination dimensions, thus every user of it would necessarily fail.
author reimar
date Sun, 03 Oct 2010 07:53:40 +0000
parents c1a2c51bed1c
children c64503cd8194
files libswscale/utils.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libswscale/utils.c	Sat Oct 02 15:03:40 2010 +0000
+++ b/libswscale/utils.c	Sun Oct 03 07:53:40 2010 +0000
@@ -1555,10 +1555,15 @@
         context->srcW      = srcW;
         context->srcH      = srcH;
         context->srcFormat = srcFormat;
+        context->dstW      = dstW;
+        context->dstH      = dstH;
         context->dstFormat = dstFormat;
         context->flags     = flags;
         context->param[0]  = param[0];
         context->param[1]  = param[1];
+        context->srcRange = handle_jpeg(&srcFormat);
+        context->dstRange = handle_jpeg(&dstFormat);
+        sws_setColorspaceDetails(context, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT], context->srcRange, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT] /* FIXME*/, context->dstRange, 0, 1<<16, 1<<16);
         if (sws_init_context(context, srcFilter, dstFilter) < 0) {
             sws_freeContext(context);
             return NULL;