[mythtv] Captions/subtitles partially broken by mythrender_opengl.cpp commit

Jim Stichnoth stichnot at gmail.com
Wed Jan 6 14:36:26 UTC 2016


On Mon, Jan 4, 2016 at 10:26 AM, Lawrence Rust <lvr at softsystem.co.uk> wrote:

> Hi Jim,
>
> Thanks for finding this.  Apologies for causing you the problem.  As you
> have a system which demonstrates this problem perhaps you would help
> debug the problem?
>
> 1. Can you add this '-O UIPainterMaxCacheHW=96' to the FE command line
> and see if the problem continues.
>

Behavior is the same with this option.


>
> 2. If no change then would you add this patch:
>
> --- a/mythtv/libs/libmythui/mythrender_opengl.cpp
> +++ b/mythtv/libs/libmythui/mythrender_opengl.cpp
> @@ -1461,6 +1461,7 @@ bool MythRenderOpenGL::ClearTexture(uint tex)
>
>      memset(scratch, 0, tmp_size);
>
> +    glCheck();
>      if ((m_textures[tex].m_type == GL_TEXTURE_1D) && m_glTexImage1D)
>      {
>          m_glTexImage1D(m_textures[tex].m_type, 0,
>
>
>
This does make the caption drawing problem go away, though obviously it
just masks the root problem.


> If the problem is resolved by this patch then the GL error is occurring
> in some previous code but being detected in ClearTexture.  In which case
> would you move the glCheck() to various lines in
> MythRenderOpenGL::CreateTexture to track which GL call is failing.  My
> guess is it's in EnableTextures.
>
>
After sprinkling glCheck() calls everywhere, it turns out the problem is
calling glLineWidth(0), which happens
in MythRenderOpenGL1::DrawRectPriv().  Applying std::max(1, ...) to the
argument "fixes" the problem.  This makes sense in the context of the
behavior in the unmodified code - all the subtitle black background
rectangles are drawn first, each of which gives this error, and then when
all the text lines are drawn, the first one fails because of the new
glCheck().

This is in part due to my commits eda5d2e2460d739ba9410c74f949b177865763f2
and 0bd79053bc7476bab4d7e71a86b37dc6b27ad05f which deliberately set the
line pen width to 0 to deal with some Qt behavioral change, with the same
rationale as your 521b12bb52ddc7282745d7dbbdd8ea2433c95dcb commit.

The std::max(1, ...) solution seems appropriate, and I'll commit it if you
agree.

I guess my next puzzle is to figure out why my systems are falling back to
the MythRenderOpenGL1 renderer...

Thanks for your help!

Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-dev/attachments/20160106/9bf9b121/attachment.html>


More information about the mythtv-dev mailing list