Skip to content

Commit 986cafd

Browse files
committed
src/player/mpvplayer: fix returning node with null texture
If mpv's render didn't have a texture ready for updatePaintNode, it would return a null texture. This fixes the issue by calling the base class implementation of updatePaintNode. This isn't visible to the user, but it does save the trouble of having an error printed to console and handled by Qt.
1 parent 8842b0d commit 986cafd

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/player/mpvplayer.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,7 @@ void MpvPlayer::doUpdate()
649649
}
650650

651651
#ifdef Q_OS_MACOS
652-
QSGNode *MpvPlayer::updatePaintNode(
653-
QSGNode *oldNode, [[maybe_unused]] UpdatePaintNodeData *data)
652+
QSGNode *MpvPlayer::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data)
654653
{
655654
QSGSimpleTextureNode *node = static_cast<QSGSimpleTextureNode *>(oldNode);
656655
if (window() == nullptr || width() <= 0 || height() <= 0)
@@ -680,6 +679,10 @@ QSGNode *MpvPlayer::updatePaintNode(
680679
node->setTexture(texture);
681680
}
682681
}
682+
else
683+
{
684+
return MpvPlayerBase::updatePaintNode(node, data);
685+
}
683686
node->setRect(boundingRect());
684687
return node;
685688
}

0 commit comments

Comments
 (0)