aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar stefano <stefano@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-01-19 21:52:00 +0000
committerGravatar stefano <stefano@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-01-19 21:52:00 +0000
commit85d89af72ebae6adf054918f4e9b42cbde81fa1e (patch)
treed6e826c71e49aaace9cb3800aa41bde51359aac0
parent2c6df2c12019d363990b9eb2aec0e8954d8587ed (diff)
Make selfTest() perform tests where both the input and output formats
are supported, avoid pointless loops. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30377 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libswscale/swscale-example.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libswscale/swscale-example.c b/libswscale/swscale-example.c
index 7c43a39467..c8faf80f55 100644
--- a/libswscale/swscale-example.c
+++ b/libswscale/swscale-example.c
@@ -198,10 +198,16 @@ static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h)
enum PixelFormat srcFormat, dstFormat;
for (srcFormat = 0; srcFormat < PIX_FMT_NB; srcFormat++) {
+ if (!sws_isSupportedInput(srcFormat))
+ continue;
+
for (dstFormat = 0; dstFormat < PIX_FMT_NB; dstFormat++) {
int i, j, k;
int res = 0;
+ if (!sws_isSupportedOutput(dstFormat))
+ continue;
+
printf("%s -> %s\n",
sws_format_name(srcFormat),
sws_format_name(dstFormat));