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
b4cce807
Commit
b4cce807
authored
Aug 07, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/Thread: move code to InternalClose()
parent
89a2e5de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
Control.hxx
src/output/Control.hxx
+5
-0
Thread.cxx
src/output/Thread.cxx
+12
-8
No files found.
src/output/Control.hxx
View file @
b4cce807
...
...
@@ -425,6 +425,11 @@ private:
/**
* Runs inside the OutputThread.
*/
void
InternalClose
(
bool
drain
)
noexcept
;
/**
* Runs inside the OutputThread.
*/
void
InternalCheckClose
(
bool
drain
)
noexcept
;
/**
...
...
src/output/Thread.cxx
View file @
b4cce807
...
...
@@ -172,16 +172,22 @@ AudioOutputControl::InternalOpen(const AudioFormat in_audio_format,
}
inline
void
AudioOutputControl
::
InternalC
heckC
lose
(
bool
drain
)
noexcept
AudioOutputControl
::
InternalClose
(
bool
drain
)
noexcept
{
if
(
!
IsOpen
())
return
;
assert
(
IsOpen
());
open
=
false
;
output
->
Close
(
drain
);
source
.
Close
();
}
inline
void
AudioOutputControl
::
InternalCheckClose
(
bool
drain
)
noexcept
{
if
(
IsOpen
())
InternalClose
(
drain
);
}
/**
* Wait until the output's delay reaches zero.
*
...
...
@@ -211,7 +217,7 @@ try {
FormatError
(
e
,
"Failed to filter for output
\"
%s
\"
[%s]"
,
GetName
(),
output
->
plugin
.
name
);
InternalC
heckC
lose
(
false
);
InternalClose
(
false
);
/* don't automatically reopen this device for 10
seconds */
...
...
@@ -259,7 +265,7 @@ AudioOutputControl::PlayChunk() noexcept
}
if
(
nbytes
==
0
)
{
InternalC
heckC
lose
(
false
);
InternalClose
(
false
);
/* don't automatically reopen this device for
10 seconds */
...
...
@@ -330,9 +336,7 @@ AudioOutputControl::InternalPause() noexcept
break
;
if
(
!
output
->
IteratePause
())
{
open
=
false
;
output
->
Close
(
false
);
source
.
Close
();
InternalClose
(
false
);
break
;
}
}
while
(
command
==
Command
::
NONE
);
...
...
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