[mythtv-commits] Ticket #12902: Cannot make QOpenGLContext current in a different thread (occurred while watching live tv)
MythTV
noreply at mythtv.org
Sun Jan 8 04:10:42 UTC 2017
#12902: Cannot make QOpenGLContext current in a different thread (occurred while
watching live tv)
-------------------------------------------------+-------------------------
Reporter: William L. DeRieux IV | Owner:
<WilliamDeRieux@…> |
Type: Bug Report - Crash | Status: new
Priority: critical | Milestone: 0.28.1
Component: Qt5 issues | Version: 0.28.0
Severity: high | Resolution:
Keywords: | Ticket locked: 0
-------------------------------------------------+-------------------------
Comment (by WilliamDeRieux@…):
Replying to [comment:10 WilliamDeRieux@…]:
> It's already testing if the version of QT is greater than or equal to
5.4, but because USE_OPENGL_QT5 is not defined unless OpenGLES is being
used -- the QT5 version of makeCurrent(m_window) is never called -- it
defaults to calling QGLContext::makeCurrent(); with no surface.
> Also, there is no point in comparing the context to
MythRenderOpenGL::currentContext() -- since it will just end up calling
QGLContext::makeCurrent() anyways
>
> And since I am using QT 5.7 -- it would make since to call the QT5
version.
> I think the method would better written like this (but I have not tried
this variant):
> {{{
> void MythRenderOpenGL::makeCurrent()
> {
> m_lock.lock();
> // Testing MythRenderOpenGL::currentContext is not reliable
> if (!m_lock_level++)
> {
> #if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
> QOpenGLContext::makeCurrent(m_window);
> #else
> QGLContext::makeCurrent();
> #endif
> }
> m_lock_level++;
> }
> }}}
>
>
I can see that the modification to this method (that I just mentioned)
would not take into account version(s) of QT less than 5.4 and as a result
would no longer call this part:
{{{
if (this != MythRenderOpenGL::currentContext())
QGLContext::makeCurrent();
m_lock_level++;
}}}
However, I suspect that versions of QT less than 5.4 should be deprecated,
especially since the use 5.4 and later should be widespread by now.
I don't know if that would be an issue.
--
Ticket URL: <https://code.mythtv.org/trac/ticket/12902#comment:11>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list