mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-04-10 17:56:26 +00:00
Destroy subpictures before the associated image
This commit is contained in:
@@ -41,12 +41,12 @@ VAAPIRenderer::~VAAPIRenderer()
|
||||
VADisplay display = vaDeviceContext->display;
|
||||
|
||||
for (int i = 0; i < Overlay::OverlayMax; i++) {
|
||||
if (m_OverlayImage[i].image_id != 0) {
|
||||
vaDestroyImage(display, m_OverlayImage[i].image_id);
|
||||
}
|
||||
if (m_OverlaySubpicture[i] != 0) {
|
||||
vaDestroySubpicture(display, m_OverlaySubpicture[i]);
|
||||
}
|
||||
if (m_OverlayImage[i].image_id != 0) {
|
||||
vaDestroyImage(display, m_OverlayImage[i].image_id);
|
||||
}
|
||||
}
|
||||
|
||||
av_buffer_unref(&m_HwContext);
|
||||
@@ -483,6 +483,14 @@ void VAAPIRenderer::notifyOverlayUpdated(Overlay::OverlayType type)
|
||||
m_OverlaySubpicture[type] = 0;
|
||||
SDL_UnlockMutex(m_OverlayMutex);
|
||||
|
||||
if (oldSubpictureId != 0) {
|
||||
status = vaDestroySubpicture(vaDeviceContext->display, oldSubpictureId);
|
||||
if (status != VA_STATUS_SUCCESS) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"vaDestroySubpicture() failed: %d",
|
||||
status);
|
||||
}
|
||||
}
|
||||
if (oldImageId != 0) {
|
||||
status = vaDestroyImage(vaDeviceContext->display, oldImageId);
|
||||
if (status != VA_STATUS_SUCCESS) {
|
||||
@@ -490,12 +498,6 @@ void VAAPIRenderer::notifyOverlayUpdated(Overlay::OverlayType type)
|
||||
"vaDestroyImage() failed: %d",
|
||||
status);
|
||||
}
|
||||
status = vaDestroySubpicture(vaDeviceContext->display, oldSubpictureId);
|
||||
if (status != VA_STATUS_SUCCESS) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"vaDestroySubpicture() failed: %d",
|
||||
status);
|
||||
}
|
||||
}
|
||||
|
||||
if (!Session::get()->getOverlayManager().isOverlayEnabled(type)) {
|
||||
|
||||
Reference in New Issue
Block a user