Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
82a10225
Commit
82a10225
authored
10 years ago
by
Luca Barbato
Browse files
Options
Downloads
Patches
Plain Diff
xcbgrab: Do not assume the non shm image data is always available
Signed-off-by:
Luca Barbato
<
lu_zero@gentoo.org
>
parent
a09c499a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavdevice/xcbgrab.c
+14
-2
14 additions, 2 deletions
libavdevice/xcbgrab.c
with
14 additions
and
2 deletions
libavdevice/xcbgrab.c
+
14
−
2
View file @
82a10225
...
...
@@ -145,13 +145,25 @@ static int xcbgrab_frame(AVFormatContext *s, AVPacket *pkt)
xcb_get_image_cookie_t
iq
;
xcb_get_image_reply_t
*
img
;
xcb_drawable_t
drawable
=
c
->
screen
->
root
;
xcb_generic_error_t
*
e
=
NULL
;
uint8_t
*
data
;
int
length
,
ret
;
iq
=
xcb_get_image
(
c
->
conn
,
XCB_IMAGE_FORMAT_Z_PIXMAP
,
drawable
,
c
->
x
,
c
->
y
,
c
->
width
,
c
->
height
,
~
0
);
img
=
xcb_get_image_reply
(
c
->
conn
,
iq
,
NULL
);
img
=
xcb_get_image_reply
(
c
->
conn
,
iq
,
&
e
);
if
(
e
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Cannot get the image data "
"event_error: response_type:%u error_code:%u "
"sequence:%u resource_id:%u minor_code:%u major_code:%u.
\n
"
,
e
->
response_type
,
e
->
error_code
,
e
->
sequence
,
e
->
resource_id
,
e
->
minor_code
,
e
->
major_code
);
return
AVERROR
(
EACCES
);
}
if
(
!
img
)
return
AVERROR
(
EAGAIN
);
...
...
@@ -405,7 +417,7 @@ static int xcbgrab_read_packet(AVFormatContext *s, AVPacket *pkt)
ret
=
xcbgrab_frame
(
s
,
pkt
);
#if CONFIG_LIBXCB_XFIXES
if
(
c
->
draw_mouse
&&
p
->
same_screen
)
if
(
ret
>=
0
&&
c
->
draw_mouse
&&
p
->
same_screen
)
xcbgrab_draw_mouse
(
s
,
pkt
,
p
,
geo
);
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment