Fix SDL renderer scaling at non-native resolution

This commit is contained in:
Cameron Gutman 2018-07-16 02:07:32 -07:00
parent 998d837ff4
commit ca20d28a24
2 changed files with 7 additions and 0 deletions

View file

@ -37,6 +37,10 @@ bool SdlRenderer::initialize(SDL_Window* window,
return false;
}
// The window may be smaller than the stream size, so ensure our
// logical rendering surface size is equal to the stream size
SDL_RenderSetLogicalSize(m_Renderer, width, height);
m_Texture = SDL_CreateTexture(m_Renderer,
SDL_PIXELFORMAT_YV12,
SDL_TEXTUREACCESS_STREAMING,

View file

@ -139,6 +139,9 @@ int Session::drSetup(int videoFormat, int width, int height, int /* frameRate */
{
AVCodec* decoder;
// Use linear filtering when renderer scaling is required
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1");
av_init_packet(&s_Pkt);
if (!chooseDecoder(s_ActiveSession->m_Preferences.videoDecoderSelection,