GNOME Bugzilla – Bug 615789
[ximagesink] gst_ximagesink_xwindow_update_geometry: assertion `xwindow != NULL' failed
Last modified: 2010-04-16 13:11:43 UTC
Just got this in totem with git: tpm@zingle:~/gst/git/totem/src$ ./totem /path/to/foo.avi ** (lt-totem:11866): CRITICAL **: gst_ximagesink_xwindow_update_geometry: assertion `xwindow != NULL' failed Doesn't seem easy to reproduce though, must be a race of some sort.
Stefan, any chance this may have been introduced by this commit of yours? commit 7b13aeee329834a29642360f958f27a6ef23bcf7 Author: Stefan Kost <ensonic@users.sf.net> Date: Tue Feb 16 12:06:08 2010 +0200 x(v)imagesink: take new size from event thread and do not poll for every frame We can update the geometry in ConfigureNotify (unless we disable event- handling). If event handling is disabled, one should use _expose() to trigger a redraw and update the geometry.
A backtrace would be nice. gst_ximagesink_xwindow_update_geometry is called from two places: gst_ximagesink_expose() gst_ximagesink_handle_xevents() here it is called within while (XCheckWindowEvent (ximagesink->xcontext->disp, ximagesink->xwindow->win, ExposureMask | StructureNotifyMask, &e)) { so the assert would trigger earlier. But then the check is a bit stupid nowadays. From the two places where we call with we pass ximagesink->xwindow as xwindow and inside gst_ximagesink_xwindow_update_geometry() deref ximagesink->xwindow again. So the assert should either just check ximagesink->xwindow and we remove the extra parameter or we use the passed parameter. The former change is already in xvimagesink. I attach a patch in a sec.
Created attachment 158789 [details] [review] refactor _update_goemetry()
This could come from gst_ximagesink_expose(). We call this also from the event thread (both ximagesink and xvimagesink). The expose impl look like this: gst_ximagesink_xwindow_update_geometry (ximagesink); gst_ximagesink_ximage_put (ximagesink, NULL); where _put is handling ximagesink>xwindow == NULL. Simmilar we could drop the assert from _update_geometry() and add this check. if (G_UNLIKELY (ximagesink->xwindow == NULL)) { g_mutex_unlock (ximagesink->flow_lock); return; }
Stack trace: (gdb) bt
+ Trace 221382
It seems fairly easy to produce if you start totem and press the 'F' key for fullscreen as soon as it comes up.
Created attachment 158798 [details] [review] gracefully handle ximagesink>xwindow == NULL
Comment on attachment 158798 [details] [review] gracefully handle ximagesink>xwindow == NULL Thanks, these patches fix the problem for me and look pretty harmless to me.