1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

swscale: use SwsContext for av_log when available

Signed-off-by: Diego Biurrun <diego@biurrun.de>
This commit is contained in:
Janne Grunau 2011-04-26 00:27:48 +02:00 committed by Diego Biurrun
parent a60466dbc3
commit 3636e791ec

View File

@ -787,11 +787,11 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
unscaled = (srcW == dstW && srcH == dstH); unscaled = (srcW == dstW && srcH == dstH);
if (!isSupportedIn(srcFormat)) { if (!isSupportedIn(srcFormat)) {
av_log(NULL, AV_LOG_ERROR, "swScaler: %s is not supported as input pixel format\n", sws_format_name(srcFormat)); av_log(c, AV_LOG_ERROR, "%s is not supported as input pixel format\n", sws_format_name(srcFormat));
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
if (!isSupportedOut(dstFormat)) { if (!isSupportedOut(dstFormat)) {
av_log(NULL, AV_LOG_ERROR, "swScaler: %s is not supported as output pixel format\n", sws_format_name(dstFormat)); av_log(c, AV_LOG_ERROR, "%s is not supported as output pixel format\n", sws_format_name(dstFormat));
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
@ -807,12 +807,12 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
|SWS_SPLINE |SWS_SPLINE
|SWS_BICUBLIN); |SWS_BICUBLIN);
if(!i || (i & (i-1))) { if(!i || (i & (i-1))) {
av_log(NULL, AV_LOG_ERROR, "swScaler: Exactly one scaler algorithm must be chosen\n"); av_log(c, AV_LOG_ERROR, "Exactly one scaler algorithm must be chosen\n");
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
/* sanity check */ /* sanity check */
if (srcW<4 || srcH<1 || dstW<8 || dstH<1) { //FIXME check if these are enough and try to lowwer them after fixing the relevant parts of the code if (srcW<4 || srcH<1 || dstW<8 || dstH<1) { //FIXME check if these are enough and try to lowwer them after fixing the relevant parts of the code
av_log(NULL, AV_LOG_ERROR, "swScaler: %dx%d -> %dx%d is invalid scaling dimension\n", av_log(c, AV_LOG_ERROR, "%dx%d -> %dx%d is invalid scaling dimension\n",
srcW, srcH, dstW, dstH); srcW, srcH, dstW, dstH);
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }