Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
17d2ca87
Commit
17d2ca87
authored
Dec 13, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: convert to standard atomic ops
parent
3f0251b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
src/audio_output/aout_internal.h
src/audio_output/aout_internal.h
+1
-1
src/audio_output/dec.c
src/audio_output/dec.c
+5
-8
No files found.
src/audio_output/aout_internal.h
View file @
17d2ca87
...
...
@@ -75,7 +75,7 @@ typedef struct
bool
recycle_vout
;
atomic_uint
buffers_lost
;
vlc_atomic_t
restart
;
atomic_uchar
restart
;
}
aout_owner_t
;
typedef
struct
...
...
src/audio_output/dec.c
View file @
17d2ca87
...
...
@@ -33,7 +33,6 @@
#include <vlc_common.h>
#include <vlc_aout.h>
#include <vlc_input.h>
#include <vlc_atomic.h>
#include "aout_internal.h"
#include "libvlc.h"
...
...
@@ -76,7 +75,7 @@ int aout_DecNew( audio_output_t *p_aout,
/* Create the audio output stream */
owner
->
volume
=
aout_volume_New
(
p_aout
,
p_replay_gain
);
vlc_atomic_set
(
&
owner
->
restart
,
0
);
atomic_store
(
&
owner
->
restart
,
0
);
owner
->
input_format
=
*
p_format
;
owner
->
mixer_format
=
owner
->
input_format
;
...
...
@@ -129,11 +128,9 @@ static int aout_CheckReady (audio_output_t *aout)
aout_assert_locked
(
aout
);
int
restart
=
vlc_atomic_swap
(
&
owner
->
restart
,
0
);
int
restart
=
atomic_exchange
(
&
owner
->
restart
,
0
);
if
(
unlikely
(
restart
))
{
assert
(
restart
&
AOUT_RESTART_INPUT
);
const
aout_request_vout_t
request_vout
=
owner
->
request_vout
;
aout_FiltersDelete
(
aout
);
...
...
@@ -168,8 +165,8 @@ static void aout_RequestRestart (audio_output_t *aout)
{
aout_owner_t
*
owner
=
aout_owner
(
aout
);
/*
DO NOT remove AOUT_RESTART_INPUT. You need to change the atomic ops
. */
vlc_atomic_set
(
&
owner
->
restart
,
AOUT_RESTART_OUTPUT
|
AOUT_RESTART_IN
PUT
);
/*
NOTE: restarting output requires restarting input
. */
atomic_fetch_or
(
&
owner
->
restart
,
AOUT_RESTART_OUT
PUT
);
}
int
aout_ChannelsRestart
(
vlc_object_t
*
obj
,
const
char
*
varname
,
...
...
@@ -196,7 +193,7 @@ void aout_InputRequestRestart (audio_output_t *aout)
{
aout_owner_t
*
owner
=
aout_owner
(
aout
);
vlc_atomic_compare_swap
(
&
owner
->
restart
,
0
,
AOUT_RESTART_INPUT
);
atomic_fetch_or
(
&
owner
->
restart
,
AOUT_RESTART_INPUT
);
}
...
...
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