Make selfTest() perform tests where both the input and output formats
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Tue, 19 Jan 2010 21:52:00 +0000 (21:52 +0000)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Tue, 19 Jan 2010 21:52:00 +0000 (21:52 +0000)
are supported, avoid pointless loops.

Originally committed as revision 30377 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale

libswscale/swscale-example.c

index 7c43a39..c8faf80 100644 (file)
@@ -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));