summaryrefslogtreecommitdiffstats
path: root/src/qtmultimediaquicktools/qsgvideonode_texture.cpp
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@theqtcompany.com>2015-07-17 11:37:02 +0200
committerYoann Lopes <yoann.lopes@theqtcompany.com>2015-07-20 10:25:52 +0000
commitf25034afaf67c32057797ae790505e57a92deffc (patch)
tree446aca3d7df8866a0d1e9368cf18526596f82058 /src/qtmultimediaquicktools/qsgvideonode_texture.cpp
parent9ae70447d507dc44f0b3402340a23946d1863056 (diff)
Fix video nodes material comparison.
Don't consider a material equal to another when their texture IDs are not available yet. Change-Id: Id4127d71abb2db33950a206dc722b24ab626e960 Task-number: QTBUG-47205 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/qtmultimediaquicktools/qsgvideonode_texture.cpp')
-rw-r--r--src/qtmultimediaquicktools/qsgvideonode_texture.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qtmultimediaquicktools/qsgvideonode_texture.cpp b/src/qtmultimediaquicktools/qsgvideonode_texture.cpp
index fd8d8719c..500c1c62f 100644
--- a/src/qtmultimediaquicktools/qsgvideonode_texture.cpp
+++ b/src/qtmultimediaquicktools/qsgvideonode_texture.cpp
@@ -138,6 +138,10 @@ public:
virtual int compare(const QSGMaterial *other) const {
const QSGVideoMaterial_Texture *m = static_cast<const QSGVideoMaterial_Texture *>(other);
+
+ if (!m_textureId)
+ return 1;
+
int diff = m_textureId - m->m_textureId;
if (diff)
return diff;