changeset 30314:a526bb14dea7

Factorize error message logging in rgb2rgbWrapper().
author stefano
date Sun, 17 Jan 2010 15:11:25 +0000
parents 7f7591482564
children 826b65c76d03
files libswscale/swscale.c
diffstat 1 files changed, 4 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libswscale/swscale.c	Sun Jan 17 15:08:31 2010 +0000
+++ b/libswscale/swscale.c	Sun Jan 17 15:11:25 2010 +0000
@@ -2085,8 +2085,6 @@
         case 0x83: conv= rgb15to32; break;
         case 0x84: conv= rgb16to32; break;
         case 0x86: conv= rgb24to32; break;
-        default: av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n",
-                        sws_format_name(srcFormat), sws_format_name(dstFormat)); break;
         }
     } else if (  (isBGR(srcFormat) && isRGB(dstFormat))
              || (isRGB(srcFormat) && isBGR(dstFormat))) {
@@ -2107,15 +2105,13 @@
         case 0x84: conv= rgb16tobgr32; break;
         case 0x86: conv= rgb24tobgr32; break;
         case 0x88: conv= rgb32tobgr32; break;
-        default: av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n",
-                        sws_format_name(srcFormat), sws_format_name(dstFormat)); break;
         }
-    } else {
+    }
+
+    if (!conv) {
         av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n",
                sws_format_name(srcFormat), sws_format_name(dstFormat));
-    }
-
-    if(conv) {
+    } else {
         const uint8_t *srcPtr= src[0];
         if(srcFormat == PIX_FMT_RGB32_1 || srcFormat == PIX_FMT_BGR32_1)
             srcPtr += ALT32_CORR;