Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
32272ce5
Commit
32272ce5
authored
Aug 10, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: introduce aout_Destroy()
parent
4b7f5624
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
8 deletions
+24
-8
src/audio_output/aout_internal.h
src/audio_output/aout_internal.h
+2
-2
src/audio_output/common.c
src/audio_output/common.c
+5
-0
src/input/resource.c
src/input/resource.c
+17
-6
No files found.
src/audio_output/aout_internal.h
View file @
32272ce5
...
@@ -172,9 +172,9 @@ void aout_OutputDelete( audio_output_t * p_aout );
...
@@ -172,9 +172,9 @@ void aout_OutputDelete( audio_output_t * p_aout );
/* From common.c : */
/* From common.c : */
/* Release with vlc_object_release() */
audio_output_t
*
aout_New
(
vlc_object_t
*
);
audio_output_t
*
aout_New
(
vlc_object_t
*
);
#define aout_New(a) aout_New(VLC_OBJECT(a))
#define aout_New(a) aout_New(VLC_OBJECT(a))
void
aout_Destroy
(
audio_output_t
*
);
void
aout_FifoInit
(
vlc_object_t
*
,
aout_fifo_t
*
,
uint32_t
);
void
aout_FifoInit
(
vlc_object_t
*
,
aout_fifo_t
*
,
uint32_t
);
mtime_t
aout_FifoFirstDate
(
const
aout_fifo_t
*
)
VLC_USED
;
mtime_t
aout_FifoFirstDate
(
const
aout_fifo_t
*
)
VLC_USED
;
...
...
src/audio_output/common.c
View file @
32272ce5
...
@@ -168,6 +168,11 @@ audio_output_t *aout_New( vlc_object_t * p_parent )
...
@@ -168,6 +168,11 @@ audio_output_t *aout_New( vlc_object_t * p_parent )
return
aout
;
return
aout
;
}
}
void
aout_Destroy
(
audio_output_t
*
aout
)
{
vlc_object_release
(
aout
);
}
/*****************************************************************************
/*****************************************************************************
* aout_Destructor: destroy aout structure
* aout_Destructor: destroy aout structure
*****************************************************************************/
*****************************************************************************/
...
...
src/input/resource.c
View file @
32272ce5
...
@@ -328,17 +328,27 @@ exit:
...
@@ -328,17 +328,27 @@ exit:
static
void
DestroyAout
(
input_resource_t
*
p_resource
)
static
void
DestroyAout
(
input_resource_t
*
p_resource
)
{
{
if
(
p_resource
->
p_aout
)
if
(
p_resource
->
p_aout
)
vlc_object_release
(
p_resource
->
p_aout
);
{
p_resource
->
p_aout
=
NULL
;
aout_Destroy
(
p_resource
->
p_aout
);
p_resource
->
p_aout
=
NULL
;
}
}
}
static
void
ReleaseAout
(
input_resource_t
*
p_resource
,
static
void
ReleaseAout
(
input_resource_t
*
p_resource
,
audio_output_t
*
p_aout
)
audio_output_t
*
p_aout
)
{
{
msg_Dbg
(
p_resource
->
p_parent
,
"releasing audio output"
);
if
(
likely
(
p_aout
==
p_resource
->
p_aout
)
)
if
(
likely
(
p_aout
==
p_resource
->
p_aout
)
)
{
assert
(
p_resource
->
b_aout_busy
);
p_resource
->
b_aout_busy
=
false
;
p_resource
->
b_aout_busy
=
false
;
vlc_object_release
(
p_aout
);
msg_Dbg
(
p_resource
->
p_parent
,
"releasing audio output"
);
vlc_object_release
(
p_aout
);
}
else
{
msg_Dbg
(
p_resource
->
p_parent
,
"destroying extra audio output"
);
aout_Destroy
(
p_aout
);
}
}
}
static
audio_output_t
*
AllocateAout
(
input_resource_t
*
p_resource
)
static
audio_output_t
*
AllocateAout
(
input_resource_t
*
p_resource
)
...
@@ -347,7 +357,7 @@ static audio_output_t *AllocateAout( input_resource_t *p_resource )
...
@@ -347,7 +357,7 @@ static audio_output_t *AllocateAout( input_resource_t *p_resource )
if
(
unlikely
(
p_resource
->
b_aout_busy
)
)
if
(
unlikely
(
p_resource
->
b_aout_busy
)
)
{
{
msg_Dbg
(
p_resource
->
p_parent
,
"creating audio output"
);
msg_Dbg
(
p_resource
->
p_parent
,
"creating
extra
audio output"
);
return
aout_New
(
p_resource
->
p_parent
);
return
aout_New
(
p_resource
->
p_parent
);
}
}
...
@@ -360,6 +370,7 @@ static audio_output_t *AllocateAout( input_resource_t *p_resource )
...
@@ -360,6 +370,7 @@ static audio_output_t *AllocateAout( input_resource_t *p_resource )
return
NULL
;
return
NULL
;
vlc_mutex_lock
(
&
p_resource
->
lock_hold
);
vlc_mutex_lock
(
&
p_resource
->
lock_hold
);
assert
(
p_resource
->
p_aout
==
NULL
);
p_resource
->
p_aout
=
p_aout
;
p_resource
->
p_aout
=
p_aout
;
vlc_mutex_unlock
(
&
p_resource
->
lock_hold
);
vlc_mutex_unlock
(
&
p_resource
->
lock_hold
);
}
}
...
@@ -406,7 +417,7 @@ static void TerminateAout( input_resource_t *p_resource )
...
@@ -406,7 +417,7 @@ static void TerminateAout( input_resource_t *p_resource )
vlc_mutex_unlock
(
&
p_resource
->
lock_hold
);
vlc_mutex_unlock
(
&
p_resource
->
lock_hold
);
if
(
p_aout
)
if
(
p_aout
)
vlc_object_release
(
p_aout
);
aout_Destroy
(
p_aout
);
}
}
static
void
Destructor
(
gc_object_t
*
p_gc
)
static
void
Destructor
(
gc_object_t
*
p_gc
)
...
...
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