From 8af98817e10ab79fffba4f7afa83f52e600a1dee Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Mon, 13 Sep 2021 10:38:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BD=8E=E7=89=88=E6=9C=ACsd?= =?UTF-8?q?l,test=5Fplayer=E7=BC=96=E8=AF=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- player/YuvDisplayer.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/player/YuvDisplayer.h b/player/YuvDisplayer.h index 9b67d32d..f08a157c 100644 --- a/player/YuvDisplayer.h +++ b/player/YuvDisplayer.h @@ -172,14 +172,17 @@ public: } } if (_texture) { +#if (SDL_PATCHLEVEL >= 16 || SDL_MINOR_VERSION > 0) //需要更新sdl到最新(>=2.0.16) if (pFrame->format == AV_PIX_FMT_NV12) { SDL_UpdateNVTexture( _texture, nullptr, pFrame->data[0], pFrame->linesize[0], pFrame->data[1], pFrame->linesize[1]); - } else { + } else +#endif + { SDL_UpdateYUVTexture( - _texture, nullptr, pFrame->data[0], pFrame->linesize[0], pFrame->data[1], pFrame->linesize[1], - pFrame->data[2], pFrame->linesize[2]); + _texture, nullptr, pFrame->data[0], pFrame->linesize[0], pFrame->data[1], pFrame->linesize[1], + pFrame->data[2], pFrame->linesize[2]); } //SDL_UpdateTexture(_texture, nullptr, pFrame->data[0], pFrame->linesize[0]);