mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-30 02:58:24 +00:00
ximagesrc: avoid blocking wait for X events
XNextEvent() blocks indefinitely in absence of X11 events, which can prevent the pipeline from stopping. This can cause problems when ximagesrc is used in "remote desktop" scenarios and the GStreamer application itself, through which the user is viewing and controlling the machine, is the only source of input events. Replace the call with non-blocking XCheckTypedEvent(). Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1438>
This commit is contained in:
parent
f509578de5
commit
6d67b43352
1 changed files with 2 additions and 3 deletions
|
@ -547,9 +547,8 @@ gst_ximage_src_ximage_get (GstXImageSrc * ximagesrc)
|
|||
do {
|
||||
XDamageNotifyEvent *damage_ev = (XDamageNotifyEvent *) (&ev);
|
||||
|
||||
XNextEvent (ximagesrc->xcontext->disp, &ev);
|
||||
|
||||
if (ev.type == ximagesrc->damage_event_base + XDamageNotify &&
|
||||
if (XCheckTypedEvent (ximagesrc->xcontext->disp,
|
||||
ximagesrc->damage_event_base + XDamageNotify, &ev) &&
|
||||
damage_ev->level == XDamageReportNonEmpty) {
|
||||
|
||||
XDamageSubtract (ximagesrc->xcontext->disp, ximagesrc->damage, None,
|
||||
|
|
Loading…
Reference in a new issue