diff options
Diffstat (limited to 'src/DecoderControl.cxx')
-rw-r--r-- | src/DecoderControl.cxx | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/DecoderControl.cxx b/src/DecoderControl.cxx index ab460ced0..d78fc66c9 100644 --- a/src/DecoderControl.cxx +++ b/src/DecoderControl.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2013 The Music Player Daemon Project + * Copyright (C) 2003-2014 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -20,9 +20,7 @@ #include "config.h" #include "DecoderControl.hxx" #include "MusicPipe.hxx" -#include "Song.hxx" - -#include <glib.h> +#include "DetachedSong.hxx" #include <assert.h> @@ -38,8 +36,7 @@ DecoderControl::~DecoderControl() { ClearError(); - if (song != nullptr) - song->Free(); + delete song; } void @@ -55,7 +52,7 @@ DecoderControl::WaitForDecoder() } bool -DecoderControl::IsCurrentSong(const Song &_song) const +DecoderControl::IsCurrentSong(const DetachedSong &_song) const { switch (state) { case DecoderState::STOP: @@ -64,7 +61,7 @@ DecoderControl::IsCurrentSong(const Song &_song) const case DecoderState::START: case DecoderState::DECODE: - return SongEquals(*song, _song); + return song->IsSame(_song); } assert(false); @@ -72,16 +69,14 @@ DecoderControl::IsCurrentSong(const Song &_song) const } void -DecoderControl::Start(Song *_song, +DecoderControl::Start(DetachedSong *_song, unsigned _start_ms, unsigned _end_ms, MusicBuffer &_buffer, MusicPipe &_pipe) { assert(_song != nullptr); assert(_pipe.IsEmpty()); - if (song != nullptr) - song->Free(); - + delete song; song = _song; start_ms = _start_ms; end_ms = _end_ms; |