修复低版本sdl,test_player编译问题

This commit is contained in:
ziyue 2021-09-13 10:38:32 +08:00
parent fec1307a9d
commit 8af98817e1

View File

@ -172,11 +172,14 @@ public:
} }
} }
if (_texture) { if (_texture) {
#if (SDL_PATCHLEVEL >= 16 || SDL_MINOR_VERSION > 0)
//需要更新sdl到最新>=2.0.16 //需要更新sdl到最新>=2.0.16
if (pFrame->format == AV_PIX_FMT_NV12) { if (pFrame->format == AV_PIX_FMT_NV12) {
SDL_UpdateNVTexture( SDL_UpdateNVTexture(
_texture, nullptr, pFrame->data[0], pFrame->linesize[0], pFrame->data[1], pFrame->linesize[1]); _texture, nullptr, pFrame->data[0], pFrame->linesize[0], pFrame->data[1], pFrame->linesize[1]);
} else { } else
#endif
{
SDL_UpdateYUVTexture( SDL_UpdateYUVTexture(
_texture, nullptr, pFrame->data[0], pFrame->linesize[0], pFrame->data[1], pFrame->linesize[1], _texture, nullptr, pFrame->data[0], pFrame->linesize[0], pFrame->data[1], pFrame->linesize[1],
pFrame->data[2], pFrame->linesize[2]); pFrame->data[2], pFrame->linesize[2]);