mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-10-25 13:31:41 +00:00
Avoid wedging VDPAU renderer if mixer creation fails
This commit is contained in:
1 parent
8f2e52e540
commit
40f83bd294
1 file changed
+6
-4
@@ -541,11 +541,12 @@ void VDPAURenderer::renderFrame(AVFrame* frame)
|
||||
// We need to create the mixer on the fly, because we don't know the dimensions
|
||||
// of our video surfaces in advance of decoding. We also need to recreate it when
|
||||
// the frame format or size changes.
|
||||
if (hasFrameFormatChanged(frame)) {
|
||||
if (m_VideoMixer != 0) {
|
||||
m_VdpVideoMixerDestroy(m_VideoMixer);
|
||||
}
|
||||
if (hasFrameFormatChanged(frame) && m_VideoMixer != 0) {
|
||||
m_VdpVideoMixerDestroy(m_VideoMixer);
|
||||
m_VideoMixer = 0;
|
||||
}
|
||||
|
||||
if (m_VideoMixer == 0) {
|
||||
VdpChromaType videoSurfaceChroma;
|
||||
uint32_t videoSurfaceWidth, videoSurfaceHeight;
|
||||
status = m_VdpVideoSurfaceGetParameters(videoSurface, &videoSurfaceChroma,
|
||||
@@ -580,6 +581,7 @@ void VDPAURenderer::renderFrame(AVFrame* frame)
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"VdpVideoMixerCreate() failed: %s",
|
||||
m_VdpGetErrorString(status));
|
||||
m_VideoMixer = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user