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
04146d87
Commit
04146d87
authored
May 13, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input: count references directly
The function pointer (in vlc_gc_*) was useless here.
parent
38c415da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
17 deletions
+14
-17
src/input/resource.c
src/input/resource.c
+14
-17
No files found.
src/input/resource.c
View file @
04146d87
...
...
@@ -31,6 +31,7 @@
#include <assert.h>
#include <vlc_common.h>
#include <vlc_atomic.h>
#include <vlc_vout.h>
#include <vlc_spu.h>
#include <vlc_aout.h>
...
...
@@ -44,7 +45,7 @@
struct
input_resource_t
{
VLC_GC_MEMBERS
atomic_uint
refs
;
vlc_object_t
*
p_parent
;
...
...
@@ -420,19 +421,6 @@ static void TerminateAout( input_resource_t *p_resource )
aout_Destroy
(
p_aout
);
}
static
void
Destructor
(
gc_object_t
*
p_gc
)
{
input_resource_t
*
p_resource
=
vlc_priv
(
p_gc
,
input_resource_t
);
DestroySout
(
p_resource
);
DestroyVout
(
p_resource
);
DestroyAout
(
p_resource
);
vlc_mutex_destroy
(
&
p_resource
->
lock_hold
);
vlc_mutex_destroy
(
&
p_resource
->
lock
);
free
(
p_resource
);
}
/* */
input_resource_t
*
input_resource_New
(
vlc_object_t
*
p_parent
)
{
...
...
@@ -440,7 +428,7 @@ input_resource_t *input_resource_New( vlc_object_t *p_parent )
if
(
!
p_resource
)
return
NULL
;
vlc_gc_init
(
p_resource
,
Destructor
);
atomic_init
(
&
p_resource
->
refs
,
1
);
p_resource
->
p_parent
=
p_parent
;
vlc_mutex_init
(
&
p_resource
->
lock
);
vlc_mutex_init
(
&
p_resource
->
lock_hold
);
...
...
@@ -449,12 +437,21 @@ input_resource_t *input_resource_New( vlc_object_t *p_parent )
void
input_resource_Release
(
input_resource_t
*
p_resource
)
{
vlc_gc_decref
(
p_resource
);
if
(
atomic_fetch_sub
(
&
p_resource
->
refs
,
1
)
!=
1
)
return
;
DestroySout
(
p_resource
);
DestroyVout
(
p_resource
);
DestroyAout
(
p_resource
);
vlc_mutex_destroy
(
&
p_resource
->
lock_hold
);
vlc_mutex_destroy
(
&
p_resource
->
lock
);
free
(
p_resource
);
}
input_resource_t
*
input_resource_Hold
(
input_resource_t
*
p_resource
)
{
vlc_gc_incref
(
p_resource
);
atomic_fetch_add
(
&
p_resource
->
refs
,
1
);
return
p_resource
;
}
...
...
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