Use hasFrameFormatChanged() in VDPAU
This commit is contained in:
parent
dd6f1c5873
commit
c54e6e4459
1 changed files with 7 additions and 2 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue