diff options
author | michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-02-04 18:53:01 +0000 |
---|---|---|
committer | michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-02-04 18:53:01 +0000 |
commit | 12176a29c0131a8d222cf4790e31ccebcd732dd2 (patch) | |
tree | 5df6de018221ba8c4e2399ee1fb0bf20fcb30aa2 /postproc/swscale.c | |
parent | 15daf31f0b027326042a371382bb40f8daba2455 (diff) | |
download | mpv-12176a29c0131a8d222cf4790e31ccebcd732dd2.tar.bz2 mpv-12176a29c0131a8d222cf4790e31ccebcd732dd2.tar.xz |
printing error messages if something is wrong instead of just return NULL;
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4530 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'postproc/swscale.c')
-rw-r--r-- | postproc/swscale.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/postproc/swscale.c b/postproc/swscale.c index a1bccd321f..c5a5b0d597 100644 --- a/postproc/swscale.c +++ b/postproc/swscale.c @@ -1127,11 +1127,24 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, if(srcFormat==IMGFMT_Y8) srcFormat=IMGFMT_Y800; if(dstFormat==IMGFMT_Y8) dstFormat=IMGFMT_Y800; - if(!isSupportedIn(srcFormat)) return NULL; - if(!isSupportedOut(dstFormat)) return NULL; + if(!isSupportedIn(srcFormat)) + { + fprintf(stderr, "swScaler: %s is not supported as input format\n", vo_format_name(srcFormat)); + return NULL; + } + if(!isSupportedOut(dstFormat)) + { + fprintf(stderr, "swScaler: %s is not supported as output format\n", vo_format_name(dstFormat)); + return NULL; + } /* sanity check */ - if(srcW<4 || srcH<1 || dstW<8 || dstH<1) return NULL; //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 + { + fprintf(stderr, "swScaler: %dx%d -> %dx%d is invalid scaling dimension\n", + srcW, srcH, dstW, dstH); + return NULL; + } if(!dstFilter) dstFilter= &dummyFilter; if(!srcFilter) srcFilter= &dummyFilter; |