Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
2be6184c
Commit
2be6184c
authored
Sep 01, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output_all: move _lock_signal() to output_control.c
Better name, better documentation.
parent
8b0b4ff0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
21 deletions
+23
-21
output_all.c
src/output_all.c
+3
-19
output_control.c
src/output_control.c
+12
-0
output_control.h
src/output_control.h
+8
-2
No files found.
src/output_all.c
View file @
2be6184c
...
...
@@ -206,29 +206,13 @@ static void audio_output_wait_all(void)
}
/**
* Signal the audio output if it is open, and set the "allow_play"
* flag. This function locks the mutex.
*/
static
void
audio_output_lock_signal
(
struct
audio_output
*
ao
)
{
g_mutex_lock
(
ao
->
mutex
);
ao
->
allow_play
=
true
;
if
(
audio_output_is_open
(
ao
))
g_cond_signal
(
ao
->
cond
);
g_mutex_unlock
(
ao
->
mutex
);
}
/**
* Signals all audio outputs which are open.
*/
static
void
audio_output_
signal
_all
(
void
)
audio_output_
allow_play
_all
(
void
)
{
for
(
unsigned
i
=
0
;
i
<
num_audio_outputs
;
++
i
)
audio_output_
lock_signal
(
&
audio_outputs
[
i
]);
audio_output_
allow_play
(
&
audio_outputs
[
i
]);
}
static
void
...
...
@@ -533,7 +517,7 @@ audio_output_all_cancel(void)
/* the audio outputs are now waiting for a signal, to
synchronize the cleared music pipe */
audio_output_
signal
_all
();
audio_output_
allow_play
_all
();
/* invalidate elapsed_time */
...
...
src/output_control.c
View file @
2be6184c
...
...
@@ -268,6 +268,18 @@ void audio_output_cancel(struct audio_output *ao)
}
void
audio_output_allow_play
(
struct
audio_output
*
ao
)
{
g_mutex_lock
(
ao
->
mutex
);
ao
->
allow_play
=
true
;
if
(
audio_output_is_open
(
ao
))
g_cond_signal
(
ao
->
cond
);
g_mutex_unlock
(
ao
->
mutex
);
}
void
audio_output_release
(
struct
audio_output
*
ao
)
{
if
(
ao
->
always_on
)
...
...
src/output_control.h
View file @
2be6184c
...
...
@@ -72,11 +72,17 @@ audio_output_drain_async(struct audio_output *ao);
/**
* Clear the "allow_play" flag and send the "CANCEL" command
* asynchronously. To finish the operation, the caller has to
set the
*
"allow_play" flag and signal the thread
.
* asynchronously. To finish the operation, the caller has to
call
*
audio_output_allow_play()
.
*/
void
audio_output_cancel
(
struct
audio_output
*
ao
);
/**
* Set the "allow_play" and signal the thread.
*/
void
audio_output_allow_play
(
struct
audio_output
*
ao
);
void
audio_output_close
(
struct
audio_output
*
ao
);
/**
...
...
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