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
1fa1790d
Commit
1fa1790d
authored
May 23, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/Internal: move the "pause" flag to struct AudioOutputControl
parent
dd29e6e4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
15 deletions
+13
-15
Control.cxx
src/output/Control.cxx
+2
-2
Control.hxx
src/output/Control.hxx
+6
-0
Internal.hxx
src/output/Internal.hxx
+0
-7
Thread.cxx
src/output/Thread.cxx
+5
-6
No files found.
src/output/Control.cxx
View file @
1fa1790d
...
...
@@ -181,9 +181,9 @@ AudioOutputControl::Open(const AudioFormat audio_format,
fail_timer
.
Reset
();
if
(
output
->
open
&&
audio_format
==
request
.
audio_format
)
{
assert
(
request
.
pipe
==
&
mp
||
(
always_on
&&
output
->
pause
));
assert
(
request
.
pipe
==
&
mp
||
(
always_on
&&
pause
));
if
(
!
output
->
pause
)
if
(
!
pause
)
/* already open, already the right parameters
- nothing needs to be done */
return
true
;
...
...
src/output/Control.hxx
View file @
1fa1790d
...
...
@@ -144,6 +144,12 @@ class AudioOutputControl {
bool
enabled
=
true
;
/**
* Is the device paused? i.e. the output thread is in the
* ao_pause() loop.
*/
bool
pause
=
false
;
/**
* When this flag is set, the output thread will not do any
* playback. It will wait until the flag is cleared.
*
...
...
src/output/Internal.hxx
View file @
1fa1790d
...
...
@@ -70,12 +70,6 @@ struct AudioOutput {
bool
open
=
false
;
/**
* Is the device paused? i.e. the output thread is in the
* ao_pause() loop.
*/
bool
pause
=
false
;
/**
* The configured audio format.
*/
AudioFormat
config_audio_format
;
...
...
@@ -234,7 +228,6 @@ public:
bool
IteratePause
()
noexcept
;
void
EndPause
()
noexcept
{
pause
=
false
;
}
};
...
...
src/output/Thread.cxx
View file @
1fa1790d
...
...
@@ -385,12 +385,8 @@ AudioOutputControl::InternalPlay() noexcept
inline
void
AudioOutput
::
BeginPause
()
noexcept
{
{
const
ScopeUnlock
unlock
(
mutex
);
ao_plugin_cancel
(
*
this
);
}
pause
=
true
;
const
ScopeUnlock
unlock
(
mutex
);
ao_plugin_cancel
(
*
this
);
}
inline
bool
...
...
@@ -417,6 +413,8 @@ inline void
AudioOutputControl
::
InternalPause
()
noexcept
{
output
->
BeginPause
();
pause
=
true
;
CommandFinished
();
do
{
...
...
@@ -427,6 +425,7 @@ AudioOutputControl::InternalPause() noexcept
break
;
}
while
(
command
==
Command
::
NONE
);
pause
=
false
;
output
->
EndPause
();
skip_delay
=
true
;
...
...
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