aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-01-17 23:07:37 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-01-17 23:07:37 +0000
commit398c193d0b8d5fa9255e461b31e91cee945fc00f (patch)
treef1685a9ab9fcdc549b4aa9dbd5f8df94bd1717a0
parente36a545de50480c4cce51c9479a61f94d7f421fa (diff)
downloadffmpeg-398c193d0b8d5fa9255e461b31e91cee945fc00f.tar.gz
Factorize error message logging, log it if the converter cannot be
set. Originally committed as revision 30360 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
-rw-r--r--libswscale/swscale.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 39a4341445..a2a8c83a7a 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -2032,10 +2032,7 @@ static int pal2rgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[],
uint8_t *dstPtr= dst[0] + dstStride[0]*srcSliceY;
const uint8_t *srcPtr= src[0];
- if (!usePal(srcFormat))
- av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n",
- sws_format_name(srcFormat), sws_format_name(dstFormat));
- else {
+ if (usePal(srcFormat)) {
switch (dstFormat) {
case PIX_FMT_RGB32 : conv = palette8topacked32; break;
case PIX_FMT_BGR32 : conv = palette8topacked32; break;
@@ -2043,17 +2040,19 @@ static int pal2rgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[],
case PIX_FMT_RGB32_1: conv = palette8topacked32; break;
case PIX_FMT_RGB24 : conv = palette8topacked24; break;
case PIX_FMT_BGR24 : conv = palette8topacked24; break;
- default: av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n",
- sws_format_name(srcFormat), sws_format_name(dstFormat)); break;
}
}
- if (conv)
+ if (!conv)
+ av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n",
+ sws_format_name(srcFormat), sws_format_name(dstFormat));
+ else {
for (i=0; i<srcSliceH; i++) {
conv(srcPtr, dstPtr, c->srcW, (uint8_t *) c->pal_rgb);
srcPtr+= srcStride[0];
dstPtr+= dstStride[0];
}
+ }
return srcSliceH;
}