MusicPipe: use C++11 initializers

This commit is contained in:
Max Kellermann 2016-11-23 18:04:23 +01:00
parent 4de5c216ff
commit 051cdc9670

View File

@ -38,31 +38,26 @@ class MusicBuffer;
*/
class MusicPipe {
/** the first chunk */
MusicChunk *head;
MusicChunk *head = nullptr;
/** a pointer to the tail of the chunk */
MusicChunk **tail_r;
MusicChunk **tail_r = &head;
/** the current number of chunks */
unsigned size;
unsigned size = 0;
/** a mutex which protects #head and #tail_r */
mutable Mutex mutex;
#ifndef NDEBUG
AudioFormat audio_format;
AudioFormat audio_format = AudioFormat::Undefined();
#endif
public:
/**
* Creates a new #MusicPipe object. It is empty.
*/
MusicPipe()
:head(nullptr), tail_r(&head), size(0) {
#ifndef NDEBUG
audio_format.Clear();
#endif
}
MusicPipe() = default;
/**
* Frees the object. It must be empty now.