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
9a8a3bea
Commit
9a8a3bea
authored
Nov 26, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/Control: add "noexcept"
parent
2a774a1f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
33 deletions
+33
-33
DecoderControl.cxx
src/decoder/DecoderControl.cxx
+8
-8
DecoderControl.hxx
src/decoder/DecoderControl.hxx
+24
-24
DecoderThread.cxx
src/decoder/DecoderThread.cxx
+1
-1
No files found.
src/decoder/DecoderControl.cxx
View file @
9a8a3bea
...
...
@@ -29,13 +29,13 @@
DecoderControl
::
DecoderControl
(
Mutex
&
_mutex
,
Cond
&
_client_cond
,
const
AudioFormat
_configured_audio_format
,
const
ReplayGainConfig
&
_replay_gain_config
)
const
ReplayGainConfig
&
_replay_gain_config
)
noexcept
:
thread
(
BIND_THIS_METHOD
(
RunThread
)),
mutex
(
_mutex
),
client_cond
(
_client_cond
),
configured_audio_format
(
_configured_audio_format
),
replay_gain_config
(
_replay_gain_config
)
{}
DecoderControl
::~
DecoderControl
()
DecoderControl
::~
DecoderControl
()
noexcept
{
ClearError
();
...
...
@@ -43,7 +43,7 @@ DecoderControl::~DecoderControl()
}
void
DecoderControl
::
WaitForDecoder
()
DecoderControl
::
WaitForDecoder
()
noexcept
{
assert
(
!
client_is_waiting
);
client_is_waiting
=
true
;
...
...
@@ -56,7 +56,7 @@ DecoderControl::WaitForDecoder()
void
DecoderControl
::
SetReady
(
const
AudioFormat
audio_format
,
bool
_seekable
,
SignedSongTime
_duration
)
bool
_seekable
,
SignedSongTime
_duration
)
noexcept
{
assert
(
state
==
DecoderState
::
START
);
assert
(
pipe
!=
nullptr
);
...
...
@@ -94,7 +94,7 @@ DecoderControl::IsCurrentSong(const DetachedSong &_song) const noexcept
void
DecoderControl
::
Start
(
DetachedSong
*
_song
,
SongTime
_start_time
,
SongTime
_end_time
,
MusicBuffer
&
_buffer
,
MusicPipe
&
_pipe
)
MusicBuffer
&
_buffer
,
MusicPipe
&
_pipe
)
noexcept
{
const
std
::
lock_guard
<
Mutex
>
protect
(
mutex
);
...
...
@@ -113,7 +113,7 @@ DecoderControl::Start(DetachedSong *_song,
}
void
DecoderControl
::
Stop
()
DecoderControl
::
Stop
()
noexcept
{
const
std
::
lock_guard
<
Mutex
>
protect
(
mutex
);
...
...
@@ -162,7 +162,7 @@ DecoderControl::Seek(SongTime t)
}
void
DecoderControl
::
Quit
()
DecoderControl
::
Quit
()
noexcept
{
assert
(
thread
.
IsDefined
());
...
...
@@ -173,7 +173,7 @@ DecoderControl::Quit()
}
void
DecoderControl
::
CycleMixRamp
()
DecoderControl
::
CycleMixRamp
()
noexcept
{
previous_mix_ramp
=
std
::
move
(
mix_ramp
);
mix_ramp
.
Clear
();
...
...
src/decoder/DecoderControl.hxx
View file @
9a8a3bea
...
...
@@ -177,20 +177,20 @@ struct DecoderControl {
*/
DecoderControl
(
Mutex
&
_mutex
,
Cond
&
_client_cond
,
const
AudioFormat
_configured_audio_format
,
const
ReplayGainConfig
&
_replay_gain_config
);
~
DecoderControl
();
const
ReplayGainConfig
&
_replay_gain_config
)
noexcept
;
~
DecoderControl
()
noexcept
;
/**
* Locks the object.
*/
void
Lock
()
const
{
void
Lock
()
const
noexcept
{
mutex
.
lock
();
}
/**
* Unlocks the object.
*/
void
Unlock
()
const
{
void
Unlock
()
const
noexcept
{
mutex
.
unlock
();
}
...
...
@@ -199,7 +199,7 @@ struct DecoderControl {
* player thread. The object should be locked prior to
* calling this function.
*/
void
Signal
()
{
void
Signal
()
noexcept
{
cond
.
signal
();
}
...
...
@@ -208,7 +208,7 @@ struct DecoderControl {
* is only valid in the decoder thread. The object must be locked
* prior to calling this function.
*/
void
Wait
()
{
void
Wait
()
noexcept
{
cond
.
wait
(
mutex
);
}
...
...
@@ -219,9 +219,9 @@ struct DecoderControl {
*
* Caller must hold the lock.
*/
void
WaitForDecoder
();
void
WaitForDecoder
()
noexcept
;
bool
IsIdle
()
const
{
bool
IsIdle
()
const
noexcept
{
return
state
==
DecoderState
::
STOP
||
state
==
DecoderState
::
ERROR
;
}
...
...
@@ -261,7 +261,7 @@ struct DecoderControl {
* Caller must lock the object.
*/
void
SetReady
(
const
AudioFormat
audio_format
,
bool
_seekable
,
SignedSongTime
_duration
);
bool
_seekable
,
SignedSongTime
_duration
)
noexcept
;
/**
* Checks whether an error has occurred, and if so, rethrows
...
...
@@ -290,7 +290,7 @@ struct DecoderControl {
*
* Caller must lock the object.
*/
void
ClearError
()
{
void
ClearError
()
noexcept
{
if
(
state
==
DecoderState
::
ERROR
)
{
error
=
std
::
exception_ptr
();
state
=
DecoderState
::
STOP
;
...
...
@@ -320,7 +320,7 @@ private:
* To be called from the client thread. Caller must lock the
* object.
*/
void
WaitCommandLocked
()
{
void
WaitCommandLocked
()
noexcept
{
while
(
command
!=
DecoderCommand
::
NONE
)
WaitForDecoder
();
}
...
...
@@ -332,7 +332,7 @@ private:
* To be called from the client thread. Caller must lock the
* object.
*/
void
SynchronousCommandLocked
(
DecoderCommand
cmd
)
{
void
SynchronousCommandLocked
(
DecoderCommand
cmd
)
noexcept
{
command
=
cmd
;
Signal
();
WaitCommandLocked
();
...
...
@@ -345,13 +345,13 @@ private:
* To be called from the client thread. This method locks the
* object.
*/
void
LockSynchronousCommand
(
DecoderCommand
cmd
)
{
void
LockSynchronousCommand
(
DecoderCommand
cmd
)
noexcept
{
const
std
::
lock_guard
<
Mutex
>
protect
(
mutex
);
ClearError
();
SynchronousCommandLocked
(
cmd
);
}
void
LockAsynchronousCommand
(
DecoderCommand
cmd
)
{
void
LockAsynchronousCommand
(
DecoderCommand
cmd
)
noexcept
{
const
std
::
lock_guard
<
Mutex
>
protect
(
mutex
);
command
=
cmd
;
Signal
();
...
...
@@ -365,7 +365,7 @@ public:
* To be called from the decoder thread. Caller must lock the
* mutex.
*/
void
CommandFinishedLocked
()
{
void
CommandFinishedLocked
()
noexcept
{
assert
(
command
!=
DecoderCommand
::
NONE
);
command
=
DecoderCommand
::
NONE
;
...
...
@@ -383,30 +383,30 @@ public:
* the caller)
*/
void
Start
(
DetachedSong
*
song
,
SongTime
start_time
,
SongTime
end_time
,
MusicBuffer
&
buffer
,
MusicPipe
&
pipe
);
MusicBuffer
&
buffer
,
MusicPipe
&
pipe
)
noexcept
;
void
Stop
();
void
Stop
()
noexcept
;
/**
* Throws #std::runtime_error on error.
*/
void
Seek
(
SongTime
t
);
void
Quit
();
void
Quit
()
noexcept
;
const
char
*
GetMixRampStart
()
const
{
const
char
*
GetMixRampStart
()
const
noexcept
{
return
mix_ramp
.
GetStart
();
}
const
char
*
GetMixRampEnd
()
const
{
const
char
*
GetMixRampEnd
()
const
noexcept
{
return
mix_ramp
.
GetEnd
();
}
const
char
*
GetMixRampPreviousEnd
()
const
{
const
char
*
GetMixRampPreviousEnd
()
const
noexcept
{
return
previous_mix_ramp
.
GetEnd
();
}
void
SetMixRamp
(
MixRampInfo
&&
new_value
)
{
void
SetMixRamp
(
MixRampInfo
&&
new_value
)
noexcept
{
mix_ramp
=
std
::
move
(
new_value
);
}
...
...
@@ -414,10 +414,10 @@ public:
* Move mixramp_end to mixramp_prev_end and clear
* mixramp_start/mixramp_end.
*/
void
CycleMixRamp
();
void
CycleMixRamp
()
noexcept
;
private
:
void
RunThread
();
void
RunThread
()
noexcept
;
};
#endif
src/decoder/DecoderThread.cxx
View file @
9a8a3bea
...
...
@@ -514,7 +514,7 @@ try {
}
void
DecoderControl
::
RunThread
()
DecoderControl
::
RunThread
()
noexcept
{
SetThreadName
(
"decoder"
);
...
...
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