Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
db442c87
Commit
db442c87
authored
Oct 30, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avdevice/xcbgrab: Fix offset support
Found-by: carl Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
0c9f0da0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
xcbgrab.c
libavdevice/xcbgrab.c
+13
-5
No files found.
libavdevice/xcbgrab.c
View file @
db442c87
...
...
@@ -491,7 +491,6 @@ static int create_stream(AVFormatContext *s)
{
XCBGrabContext
*
c
=
s
->
priv_data
;
AVStream
*
st
=
avformat_new_stream
(
s
,
NULL
);
const
char
*
opts
=
strchr
(
s
->
filename
,
'+'
);
xcb_get_geometry_cookie_t
gc
;
xcb_get_geometry_reply_t
*
geo
;
int
ret
;
...
...
@@ -507,9 +506,6 @@ static int create_stream(AVFormatContext *s)
if
(
ret
<
0
)
return
ret
;
if
(
opts
)
sscanf
(
opts
,
"%d,%d"
,
&
c
->
x
,
&
c
->
y
);
avpriv_set_pts_info
(
st
,
64
,
1
,
1000000
);
gc
=
xcb_get_geometry
(
c
->
conn
,
c
->
screen
->
root
);
...
...
@@ -598,8 +594,20 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s)
XCBGrabContext
*
c
=
s
->
priv_data
;
int
screen_num
,
ret
;
const
xcb_setup_t
*
setup
;
char
*
display_name
=
av_strdup
(
s
->
filename
);
if
(
s
->
filename
)
{
if
(
!
display_name
)
return
AVERROR
(
ENOMEM
);
if
(
!
sscanf
(
s
->
filename
,
"%[^+]+%d,%d"
,
display_name
,
&
c
->
x
,
&
c
->
y
))
{
*
display_name
=
0
;
sscanf
(
s
->
filename
,
"+%d,%d"
,
&
c
->
x
,
&
c
->
y
);
}
}
c
->
conn
=
xcb_connect
(
s
->
filename
,
&
screen_num
);
c
->
conn
=
xcb_connect
(
display_name
,
&
screen_num
);
av_freep
(
&
display_name
);
if
((
ret
=
xcb_connection_has_error
(
c
->
conn
)))
{
av_log
(
s
,
AV_LOG_ERROR
,
"Cannot open display %s, error %d.
\n
"
,
s
->
filename
?
s
->
filename
:
"default"
,
ret
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment