Use hasFrameFormatChanged() in VDPAU

This commit is contained in:
Cameron Gutman 2025-11-05 23:58:51 -06:00
commit c54e6e4459

View file

@ -534,8 +534,13 @@ void VDPAURenderer::renderFrame(AVFrame* frame)
m_NextSurfaceIndex = (m_NextSurfaceIndex + 1) % OUTPUT_SURFACE_COUNT; m_NextSurfaceIndex = (m_NextSurfaceIndex + 1) % OUTPUT_SURFACE_COUNT;
// We need to create the mixer on the fly, because we don't know the dimensions // We need to create the mixer on the fly, because we don't know the dimensions
// of our video surfaces in advance of decoding // of our video surfaces in advance of decoding. We also need to recreate it when
if (m_VideoMixer == 0) { // the frame format or size changes.
if (hasFrameFormatChanged(frame)) {
if (m_VideoMixer != 0) {
m_VdpVideoMixerDestroy(m_VideoMixer);
}
VdpChromaType videoSurfaceChroma; VdpChromaType videoSurfaceChroma;
uint32_t videoSurfaceWidth, videoSurfaceHeight; uint32_t videoSurfaceWidth, videoSurfaceHeight;
status = m_VdpVideoSurfaceGetParameters(videoSurface, &videoSurfaceChroma, status = m_VdpVideoSurfaceGetParameters(videoSurface, &videoSurfaceChroma,