Dark Avenger wrote:
>
> Subject: 5-10 lines of code. Do u see a bug?
>
> Using XMMS 1.2.5 and the plugin OpenGL Spectrum Analyzer 1.2.5 that comes with it
>gives errors on both X11 4.1.0 w/ DRI + tdfx driver and NVidia OGL driver. The errors
>are of type:
>
> 1) Seg. Fault and Xlib: unexpected async reply (sequence 0x1728)!
I remember seeing problems like this when I was debugging multi-threaded
apps. Does XMMS use threads in conjunction with OpenGL?
> 2) Gdk-ERROR **: BadValue (integer parameter out of range for operation) serial 45
>error_code 2 request_code 147 minor_code 13
>
> This happens when through the Vizualization menu enable/disable the plugin
>(especially if you do it really fast)
>
> Looking at the code for hours only revealed a missing XFree() [ in the
>create_window() code ]. But that didn't fix the errors.
>
> The following lines are suspicious though:
>
> if (window)
> {
> if (grabbed_pointer)
> {
> XUngrabPointer(dpy, CurrentTime);
> grabbed_pointer = FALSE;
> }
>
> XDestroyWindow(dpy, window);
> window = 0;
> }
>
> if (glxcontext)
> {
> glXMakeCurrent(dpy, 0, NULL);
> glXDestroyContext(dpy, glxcontext);
> glxcontext = NULL;
> }
>
> Note that the order of glXDestroyContext and XDestoryWindow as above. Once I
>reversed the above two if(dpy) and if(glxcontext) statements the problems went away.
>It does not seg. fault or crash XMMS.
>
> Does this mean:
>
> 1) it was OKAY initially (as shown above) and the GL drivers have a problem when the
>window is killed before the context (driver should be able to handle this)
>
> or
>
> 2) the above code is NOT OKAY. You should never kill the window before you have
>killed the context
>
> Please tell us the right way of doing things, unless you have any more ideas on why
>the plugin is crashing xmms...
I seem to recall the order of glXDestroyContext and XDestroyWindow did matter
but I thought I had fixed that a long time ago in the client-side DRI code.
I suggest you send your patch to the xmms developers (or whoever) since it
looks like a good work-around.
> PS. does glXDestroyContext do a glFlush() or waits for buffers to empty or hardware
>to be quiescent (sp?) or does it just return immediately?
I don't recall.
> The docs say about it being active in the current thread, but does that include the
>GL drivers?
Huh?
-Brian
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel