aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-08 00:35:28 +0100
committerMax Kellermann <max@duempel.org>2014-01-08 00:35:28 +0100
commitcbf57e7421f23d090715934a2deb92ff0c61f895 (patch)
treec01b3d445d65d90c3252261ba8c5e218244929fa /src
parent3f3ae48ff40f1e15dcbebb2219d628069023810b (diff)
downloadmpd-cbf57e7421f23d090715934a2deb92ff0c61f895.tar.gz
mpd-cbf57e7421f23d090715934a2deb92ff0c61f895.tar.xz
mpd-cbf57e7421f23d090715934a2deb92ff0c61f895.zip
DecoderThread: use Song references
Diffstat (limited to 'src')
-rw-r--r--src/DecoderThread.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/DecoderThread.cxx b/src/DecoderThread.cxx
index ef6655484..f71462bdf 100644
--- a/src/DecoderThread.cxx
+++ b/src/DecoderThread.cxx
@@ -347,18 +347,18 @@ decoder_run_file(Decoder &decoder, const char *path_fs)
static void
decoder_run_song(DecoderControl &dc,
- const Song *song, const char *uri)
+ const Song &song, const char *uri)
{
Decoder decoder(dc, dc.start_ms > 0,
- song->tag != nullptr && song->IsFile()
- ? new Tag(*song->tag) : nullptr);
+ song.tag != nullptr && song.IsFile()
+ ? new Tag(*song.tag) : nullptr);
int ret;
dc.state = DecoderState::START;
decoder_command_finished_locked(dc);
- ret = song->IsFile()
+ ret = song.IsFile()
? decoder_run_file(decoder, uri)
: decoder_run_stream(decoder, uri);
@@ -381,7 +381,7 @@ decoder_run_song(DecoderControl &dc,
else {
dc.state = DecoderState::ERROR;
- const char *error_uri = song->uri;
+ const char *error_uri = song.uri;
const std::string allocated = uri_remove_auth(error_uri);
if (!allocated.empty())
error_uri = allocated.c_str();
@@ -398,12 +398,12 @@ decoder_run(DecoderControl &dc)
{
dc.ClearError();
- const Song *song = dc.song;
- assert(song != nullptr);
+ assert(dc.song != nullptr);
+ const Song &song = *dc.song;
- const std::string uri = song->IsFile()
- ? std::string(map_song_fs(*song).c_str())
- : song->GetURI();
+ const std::string uri = song.IsFile()
+ ? std::string(map_song_fs(song).c_str())
+ : song.GetURI();
if (uri.empty()) {
dc.state = DecoderState::ERROR;