Revision 0810a584 libswscale/utils.c

View differences:

libswscale/utils.c
1146 1146
    return -1;
1147 1147
}
1148 1148

  
1149
#if FF_API_SWS_GETCONTEXT
1149 1150
SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
1150 1151
                           int dstW, int dstH, enum PixelFormat dstFormat, int flags,
1151 1152
                           SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param)
......
1181 1182

  
1182 1183
    return c;
1183 1184
}
1185
#endif
1184 1186

  
1185 1187
SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
1186 1188
                                float lumaSharpen, float chromaSharpen,
......
1564 1566
    }
1565 1567

  
1566 1568
    if (!context) {
1567
        return sws_getContext(srcW, srcH, srcFormat,
1568
                              dstW, dstH, dstFormat, flags,
1569
                              srcFilter, dstFilter, param);
1569
        if (!(context = sws_alloc_context()))
1570
            return NULL;
1571
        context->srcW      = srcW;
1572
        context->srcH      = srcH;
1573
        context->srcFormat = srcFormat;
1574
        context->dstFormat = dstFormat;
1575
        context->flags     = flags;
1576
        context->param[0]  = param[0];
1577
        context->param[1]  = param[1];
1578
        if (sws_init_context(context, srcFilter, dstFilter) < 0) {
1579
            sws_freeContext(context);
1580
            return NULL;
1581
        }
1570 1582
    }
1571 1583
    return context;
1572 1584
}

Also available in: Unified diff