DecoderInternal: move initializers to constructor

This commit is contained in:
Max Kellermann 2013-01-04 21:59:03 +01:00
parent e9b71a0d28
commit ffabf8b013
2 changed files with 10 additions and 13 deletions

View File

@ -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) {}
};
/**

View File

@ -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);