From ffabf8b01313e58528b0e89ccca8bc07d22d360b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 4 Jan 2013 21:59:03 +0100 Subject: DecoderInternal: move initializers to constructor --- src/DecoderInternal.hxx | 11 +++++++---- src/DecoderThread.cxx | 12 +++--------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/DecoderInternal.hxx b/src/DecoderInternal.hxx index 698e90bf1..8e3a7d4b1 100644 --- a/src/DecoderInternal.hxx +++ b/src/DecoderInternal.hxx @@ -81,12 +81,15 @@ struct decoder { */ unsigned replay_gain_serial; -#ifdef __cplusplus - decoder(decoder_control *_dc, bool _initial_seek_pending) + decoder(decoder_control *_dc, bool _initial_seek_pending, + struct tag *_tag) :dc(_dc), + timestamp(0), initial_seek_pending(_initial_seek_pending), - initial_seek_running(false) {} -#endif + initial_seek_running(false), + seeking(false), + song_tag(_tag), stream_tag(nullptr), decoder_tag(nullptr), + chunk(nullptr) {} }; /** diff --git a/src/DecoderThread.cxx b/src/DecoderThread.cxx index f6f8437ab..cf16bea2d 100644 --- a/src/DecoderThread.cxx +++ b/src/DecoderThread.cxx @@ -380,17 +380,11 @@ static void decoder_run_song(struct decoder_control *dc, const struct song *song, const char *uri) { - decoder decoder(dc, dc->start_ms > 0); + decoder decoder(dc, dc->start_ms > 0, + song->tag != NULL && song_is_file(song) + ? tag_dup(song->tag) : nullptr); int ret; - decoder.timestamp = 0.0; - decoder.seeking = false; - decoder.song_tag = song->tag != NULL && song_is_file(song) - ? tag_dup(song->tag) : NULL; - decoder.stream_tag = NULL; - decoder.decoder_tag = NULL; - decoder.chunk = NULL; - dc->state = DECODE_STATE_START; decoder_command_finished_locked(dc); -- cgit v1.2.3