1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Hopefully fixed videos on non-32bpp displays.

This commit is contained in:
Michał W. Urbańczyk
2010-08-26 16:55:42 +00:00
parent d1bfe4cbd6
commit 527a0ef4d6

View File

@@ -732,9 +732,18 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay)
codecContext->pix_fmt, codecContext->width, codecContext->height,
PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL);
} else {
PixelFormat screenFormat = PIX_FMT_NONE;
switch(screen->format->BytesPerPixel)
{
case 2: screenFormat = PIX_FMT_RGB565; break;
case 3: screenFormat = PIX_FMT_RGB24; break;
case 4: screenFormat = PIX_FMT_RGB32; break;
default: return false;
}
sws = sws_getContext(codecContext->width, codecContext->height,
codecContext->pix_fmt, codecContext->width, codecContext->height,
PIX_FMT_RGB32, SWS_BICUBIC, NULL, NULL, NULL);
screenFormat, SWS_BICUBIC, NULL, NULL, NULL);
}
if (sws == NULL)