[FFmpeg-cvslog] xcbgrab: Correctly make shm optional

Luca Barbato git at videolan.org
Sun Feb 15 20:49:09 CET 2015


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Tue Nov 25 23:38:43 2014 +0100| [d40815a982c36ff9da09ae3edb5e3bd7d97b5d42] | committer: Luca Barbato

xcbgrab: Correctly make shm optional

The segment field in the struct has to be conditionally build
as well.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d40815a982c36ff9da09ae3edb5e3bd7d97b5d42
---

 libavdevice/xcbgrab.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavdevice/xcbgrab.c b/libavdevice/xcbgrab.c
index 161bd03..23969c9 100644
--- a/libavdevice/xcbgrab.c
+++ b/libavdevice/xcbgrab.c
@@ -47,8 +47,9 @@ typedef struct XCBGrabContext {
     xcb_connection_t *conn;
     xcb_screen_t *screen;
     xcb_window_t window;
+#if CONFIG_LIBXCB_SHM
     xcb_shm_seg_t segment;
-
+#endif
     int64_t time_frame;
     AVRational time_base;
 
@@ -614,8 +615,6 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s)
         return AVERROR(EIO);
     }
 
-    c->segment = xcb_generate_id(c->conn);
-
     ret = create_stream(s);
 
     if (ret < 0) {
@@ -624,7 +623,8 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s)
     }
 
 #if CONFIG_LIBXCB_SHM
-    c->has_shm = check_shm(c->conn);
+    if ((c->has_shm = check_shm(c->conn)))
+        c->segment = xcb_generate_id(c->conn);
 #endif
 
 #if CONFIG_LIBXCB_XFIXES



More information about the ffmpeg-cvslog mailing list