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
59181ac5
Commit
59181ac5
authored
Apr 28, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/Thread: move code to BeginPause(), IteratePause()
parent
2a831fa5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
14 deletions
+31
-14
Internal.hxx
src/output/Internal.hxx
+3
-0
Thread.cxx
src/output/Thread.cxx
+28
-14
No files found.
src/output/Internal.hxx
View file @
59181ac5
...
...
@@ -516,6 +516,9 @@ private:
*/
bool
Play
();
void
BeginPause
();
bool
IteratePause
();
void
Pause
();
/**
...
...
src/output/Thread.cxx
View file @
59181ac5
...
...
@@ -365,7 +365,7 @@ AudioOutput::Play()
}
inline
void
AudioOutput
::
Pause
()
AudioOutput
::
Begin
Pause
()
{
{
const
ScopeUnlock
unlock
(
mutex
);
...
...
@@ -373,26 +373,40 @@ AudioOutput::Pause()
}
pause
=
true
;
}
inline
bool
AudioOutput
::
IteratePause
()
{
bool
success
;
try
{
const
ScopeUnlock
unlock
(
mutex
);
success
=
ao_plugin_pause
(
*
this
);
}
catch
(
const
std
::
runtime_error
&
e
)
{
FormatError
(
e
,
"
\"
%s
\"
[%s] failed to pause"
,
name
,
plugin
.
name
);
success
=
false
;
}
if
(
!
success
)
Close
(
false
);
return
success
;
}
inline
void
AudioOutput
::
Pause
()
{
BeginPause
();
CommandFinished
();
do
{
if
(
!
WaitForDelay
())
break
;
bool
success
;
try
{
const
ScopeUnlock
unlock
(
mutex
);
success
=
ao_plugin_pause
(
*
this
);
}
catch
(
const
std
::
runtime_error
&
e
)
{
FormatError
(
e
,
"
\"
%s
\"
[%s] failed to pause"
,
name
,
plugin
.
name
);
success
=
false
;
}
if
(
!
success
)
{
Close
(
false
);
if
(
!
IteratePause
())
break
;
}
}
while
(
command
==
Command
::
NONE
);
pause
=
false
;
...
...
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