Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
456
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
dd8c5c5e
Commit
dd8c5c5e
authored
6 years ago
by
Romain Vimont
Committed by
Steve Lhomme
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
core: use refcounter helper for opengl
Signed-off-by:
Steve Lhomme
<
robux4@ycbcr.xyz
>
parent
0fd485e7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/video_output/opengl.c
+5
-5
5 additions, 5 deletions
src/video_output/opengl.c
with
5 additions
and
5 deletions
src/video_output/opengl.c
+
5
−
5
View file @
dd8c5c5e
...
...
@@ -23,10 +23,10 @@
#endif
#include
<assert.h>
#include
<stdatomic.h>
#include
<stdlib.h>
#include
<vlc_common.h>
#include
<vlc_atomic.h>
#include
<vlc_opengl.h>
#include
"libvlc.h"
#include
<vlc_modules.h>
...
...
@@ -34,7 +34,7 @@
struct
vlc_gl_priv_t
{
vlc_gl_t
gl
;
atomic_
uint
ref_count
;
vlc_
atomic_
rc_t
rc
;
};
#undef vlc_gl_Create
/**
...
...
@@ -80,7 +80,7 @@ vlc_gl_t *vlc_gl_Create(struct vout_window_t *wnd, unsigned flags,
}
assert
(
gl
->
makeCurrent
&&
gl
->
releaseCurrent
&&
gl
->
swap
&&
gl
->
getProcAddress
);
atomic_init
(
&
glpriv
->
r
ef_count
,
1
);
vlc_
atomic_
rc_
init
(
&
glpriv
->
r
c
);
return
&
glpriv
->
gl
;
}
...
...
@@ -88,13 +88,13 @@ vlc_gl_t *vlc_gl_Create(struct vout_window_t *wnd, unsigned flags,
void
vlc_gl_Hold
(
vlc_gl_t
*
gl
)
{
struct
vlc_gl_priv_t
*
glpriv
=
(
struct
vlc_gl_priv_t
*
)
gl
;
atomic_
fetch_add
(
&
glpriv
->
r
ef_count
,
1
);
vlc_
atomic_
rc_inc
(
&
glpriv
->
r
c
);
}
void
vlc_gl_Release
(
vlc_gl_t
*
gl
)
{
struct
vlc_gl_priv_t
*
glpriv
=
(
struct
vlc_gl_priv_t
*
)
gl
;
if
(
atomic_
fetch_sub
(
&
glpriv
->
r
ef_count
,
1
)
!=
1
)
if
(
!
vlc_
atomic_
rc_dec
(
&
glpriv
->
r
c
)
)
return
;
module_unneed
(
gl
,
gl
->
module
);
vlc_object_release
(
gl
);
...
...
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