Commit 943c9dbe authored by stefano's avatar stefano

Factorize error message logging, log it if the converter cannot be

set.


git-svn-id: file:///var/local/repositories/mplayer/trunk/libswscale@30360 b3059339-0415-0410-9bf9-f77b7e298cf2
parent b5ba78b8
...@@ -2032,10 +2032,7 @@ static int pal2rgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], ...@@ -2032,10 +2032,7 @@ static int pal2rgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[],
uint8_t *dstPtr= dst[0] + dstStride[0]*srcSliceY; uint8_t *dstPtr= dst[0] + dstStride[0]*srcSliceY;
const uint8_t *srcPtr= src[0]; const uint8_t *srcPtr= src[0];
if (!usePal(srcFormat)) if (usePal(srcFormat)) {
av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n",
sws_format_name(srcFormat), sws_format_name(dstFormat));
else {
switch (dstFormat) { switch (dstFormat) {
case PIX_FMT_RGB32 : conv = palette8topacked32; break; case PIX_FMT_RGB32 : conv = palette8topacked32; break;
case PIX_FMT_BGR32 : 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[], ...@@ -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_RGB32_1: conv = palette8topacked32; break;
case PIX_FMT_RGB24 : conv = palette8topacked24; break; case PIX_FMT_RGB24 : conv = palette8topacked24; break;
case PIX_FMT_BGR24 : 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++) { for (i=0; i<srcSliceH; i++) {
conv(srcPtr, dstPtr, c->srcW, (uint8_t *) c->pal_rgb); conv(srcPtr, dstPtr, c->srcW, (uint8_t *) c->pal_rgb);
srcPtr+= srcStride[0]; srcPtr+= srcStride[0];
dstPtr+= dstStride[0]; dstPtr+= dstStride[0];
} }
}
return srcSliceH; return srcSliceH;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment