decoder/Control: use C++11 initializers

This commit is contained in:
Max Kellermann 2016-11-24 14:58:17 +01:00
parent b677e891b4
commit 9b9144f25d
2 changed files with 7 additions and 12 deletions

View File

@ -28,12 +28,7 @@
#include <assert.h> #include <assert.h>
DecoderControl::DecoderControl(Mutex &_mutex, Cond &_client_cond) DecoderControl::DecoderControl(Mutex &_mutex, Cond &_client_cond)
:mutex(_mutex), client_cond(_client_cond), :mutex(_mutex), client_cond(_client_cond) {}
state(DecoderState::STOP),
command(DecoderCommand::NONE),
client_is_waiting(false),
song(nullptr),
replay_gain_db(0), replay_gain_prev_db(0) {}
DecoderControl::~DecoderControl() DecoderControl::~DecoderControl()
{ {

View File

@ -89,8 +89,8 @@ struct DecoderControl {
*/ */
Cond &client_cond; Cond &client_cond;
DecoderState state; DecoderState state = DecoderState::STOP;
DecoderCommand command; DecoderCommand command = DecoderCommand::NONE;
/** /**
* The error that occurred in the decoder thread. This * The error that occurred in the decoder thread. This
@ -107,7 +107,7 @@ struct DecoderControl {
* false, the DecoderThread may omit invoking Cond::signal(), * false, the DecoderThread may omit invoking Cond::signal(),
* reducing the number of system calls. * reducing the number of system calls.
*/ */
bool client_is_waiting; bool client_is_waiting = false;
bool seek_error; bool seek_error;
bool seekable; bool seekable;
@ -127,7 +127,7 @@ struct DecoderControl {
* This is a duplicate, and must be freed when this attribute * This is a duplicate, and must be freed when this attribute
* is cleared. * is cleared.
*/ */
DetachedSong *song; DetachedSong *song = nullptr;
/** /**
* The initial seek position, e.g. to the start of a sub-track * The initial seek position, e.g. to the start of a sub-track
@ -156,8 +156,8 @@ struct DecoderControl {
*/ */
MusicPipe *pipe; MusicPipe *pipe;
float replay_gain_db; float replay_gain_db = 0;
float replay_gain_prev_db; float replay_gain_prev_db = 0;
MixRampInfo mix_ramp, previous_mix_ramp; MixRampInfo mix_ramp, previous_mix_ramp;