Skip to content

Commit

Permalink
OpenGL: Revert 'Don't call QGLContext::doneCurrent() in
Browse files Browse the repository at this point in the history
MythRenderOpenGL'

Originally committed in:-

http://svn.mythtv.org/svn/trunk@27281 7dbf422c-18fa-0310-86e9-

This should never have been committed as I completely ignored the
situation in which the decoder thread re-initialises the videooutput
class when a stream change occurs.

The change will probably break windows OpenGL video playback and from
prior testing, will probably have a negative impact on linux Intel GPU
performance.

Will fix sundry crashes when using OpenGL video playback and the stream
changes (size, interlacing etc).

The proper fix, which I've been mulling for some time, is to make the
decoder object signal to the main thread that the video parameters have
changed and a re-initialisation is needed. This is not a trivial change
though.
  • Loading branch information
Mark Kendall committed Feb 1, 2011
1 parent 399c1bc commit 25e01ee
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mythtv/libs/libmythui/mythrender_opengl.cpp
Expand Up @@ -175,11 +175,9 @@ void MythRenderOpenGL::makeCurrent()

void MythRenderOpenGL::doneCurrent()
{
// we don't explicitly call QGlContext::doneCurrent() as it should be
// unnecessary (makeCurrent() will switch contexts as necessary), it
// appears to cause performance issues and breaks rendering in certain
// situations
m_lock_level--;
if (m_lock_level == 0)
QGLContext::doneCurrent();
if (m_lock_level < 0)
VERBOSE(VB_IMPORTANT, LOC_ERR + "Mis-matched calls to makeCurrent()");
m_lock->unlock();
Expand Down

0 comments on commit 25e01ee

Please sign in to comment.