[mythtv] no video with 0.20-fixes p14649

Paul Bender pebender at san.rr.com
Sat Oct 13 22:28:30 UTC 2007

Daniel Kristjansson wrote:
> On Sat, 2007-10-13 at 11:14 -0400, Scott wrote:
>> On Sat, 2007-10-13 at 15:55 +0200, Michael Haas wrote:
>>> Try disabling OpenGL vsync. One of the users of our weekly -fixes builds
>>>  in Ubuntu is experiencing the same problems. I'll file a bug report now.
>> Yeah, that did it. I loaded up p14643 only and saw the same problem. I
>> would guess that it should be this:
>> Index: branches/release-0-20-fixes/mythtv/libs/libmythtv/vsync.cpp
>> ===================================================================
>> --- Revision 11610
>> +++ Revision 14643
>> @@ -469,5, +469,13 @@
>>       __GLXextFuncPtr glXGetProcAddress(const char * const procName) 
>>       { 
>> -         __GLXextFuncPtr ret = glXGetProcAddressARB((const GLubyte *) procName); 
>> +         __GLXextFuncPtr ret = NULL; 
>> +  
>> + #if GLX_VERSION_1_4 
>> +         X11S(ret = glXGetProcAddress(procName)); 
>> + #elif GLX_ARB_get_proc_address 
>> +         X11S(ret = glXGetProcAddressARB((const GLubyte *) procName)); 
>> + #elif GLX_EXT_get_proc_address 
>> +         X11S(ret = glXGetProcAddressEXT(procName)); 
>> + #endif 
>>           if (!ret) 
> If this is the issue my guess is that the GLX headers are incorrect
> for whoever is compiling the packages. The headers probably say that
> you have GLX 1.4, but the libraries actually don't have GLX 1.4 support.
> What video drivers are you using? What version? What GLX headers were
> used during the compile?
> We could rewrite this to use glXQueryVersion() and glXQueryExtension()
> which are GLX 1.0 functions. It would be a bit more complicated but
> should allow this code to work for older GLX libraries that the headers
> the code was compiled with.. If this is indeed the problem please open
> up a ticket explaining the problem and I'll have a look at it.
> -- Daniel

I believe that there is a bug. Specifically, I believe that there is a 
scope problem.

There is function glXGetProcAddress with class scope and a function 
named glXGetProcAddress with global scope. The class function 
glXGetProcAddress wants to call the global function glXGetProcAddress. 
However, it is calling the class function. That is, it is calling 
itself. One can tell this is what is happening because the code compiles 
without casting the argument to the type (const GLubyte *), which is the 
argument type of the global function.

To fix this, the line:

X11S(ret = glXGetProcAddress(procName));

should be replaced with the line

X11S(ret = ::glXGetProcAddress((const GLubyte *) procName));

Notice the addition of the scope operator '::' and the argument cast 
'(const GLubyte *)'.

Having scope can be nice. Unfortunately, it can bite you in unexpected 
ways as well.

Without the above change, I have the described failure on my system. 
With the above change it works on my system.

I have attached a patch against 0.20 fixes.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mythtv-0.20.2-scope_fix.patch
Url: http://mythtv.org/pipermail/mythtv-dev/attachments/20071013/c366af2a/attachment.diff 

More information about the mythtv-dev mailing list