Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
89c0c777
Commit
89c0c777
authored
Oct 04, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XCB: factor segment detachment on error
parent
6d3bc51a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
8 deletions
+14
-8
modules/video_output/xcb/pictures.c
modules/video_output/xcb/pictures.c
+8
-1
modules/video_output/xcb/pictures.h
modules/video_output/xcb/pictures.h
+2
-1
modules/video_output/xcb/x11.c
modules/video_output/xcb/x11.c
+2
-5
modules/video_output/xcb/xvideo.c
modules/video_output/xcb/xvideo.c
+2
-1
No files found.
modules/video_output/xcb/pictures.c
View file @
89c0c777
...
...
@@ -150,10 +150,17 @@ int XCB_picture_Alloc (vout_display_t *vd, picture_resource_t *res,
}
picture_t
*
XCB_picture_NewFromResource
(
const
video_format_t
*
restrict
fmt
,
const
picture_resource_t
*
restrict
res
)
const
picture_resource_t
*
restrict
res
,
xcb_connection_t
*
conn
)
{
picture_t
*
pic
=
picture_NewFromResource
(
fmt
,
res
);
if
(
unlikely
(
pic
==
NULL
))
{
xcb_shm_seg_t
seg
=
(
uintptr_t
)
res
->
p_sys
;
if
(
seg
!=
0
)
xcb_shm_detach
(
conn
,
seg
);
shmdt
(
res
->
p
[
0
].
p_pixels
);
}
return
pic
;
}
modules/video_output/xcb/pictures.h
View file @
89c0c777
...
...
@@ -34,7 +34,8 @@ bool XCB_shm_Check (vlc_object_t *obj, xcb_connection_t *conn);
int
XCB_picture_Alloc
(
vout_display_t
*
,
picture_resource_t
*
,
size_t
size
,
xcb_connection_t
*
,
xcb_shm_seg_t
);
picture_t
*
XCB_picture_NewFromResource
(
const
video_format_t
*
,
const
picture_resource_t
*
);
const
picture_resource_t
*
,
xcb_connection_t
*
);
static
inline
xcb_shm_seg_t
XCB_picture_GetSegment
(
const
picture_t
*
pic
)
{
...
...
modules/video_output/xcb/x11.c
View file @
89c0c777
...
...
@@ -393,13 +393,10 @@ static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count)
if
(
XCB_picture_Alloc
(
vd
,
&
res
,
size
,
sys
->
conn
,
seg
))
break
;
pic_array
[
count
]
=
XCB_picture_NewFromResource
(
&
vd
->
fmt
,
&
res
);
pic_array
[
count
]
=
XCB_picture_NewFromResource
(
&
vd
->
fmt
,
&
res
,
sys
->
conn
);
if
(
unlikely
(
pic_array
[
count
]
==
NULL
))
{
if
(
seg
!=
0
)
xcb_shm_detach
(
sys
->
conn
,
seg
);
break
;
}
}
xcb_flush
(
sys
->
conn
);
...
...
modules/video_output/xcb/xvideo.c
View file @
89c0c777
...
...
@@ -661,7 +661,8 @@ static void PoolAlloc (vout_display_t *vd, unsigned requested_count)
res
.
p
[
1
].
p_pixels
=
buf
;
}
pic_array
[
count
]
=
XCB_picture_NewFromResource
(
&
vd
->
fmt
,
&
res
);
pic_array
[
count
]
=
XCB_picture_NewFromResource
(
&
vd
->
fmt
,
&
res
,
p_sys
->
conn
);
if
(
unlikely
(
pic_array
[
count
]
==
NULL
))
break
;
}
...
...
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