aboutsummaryrefslogtreecommitdiffstats
path: root/src/DecoderThread.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-17 01:01:15 +0200
committerMax Kellermann <max@duempel.org>2013-10-17 01:01:15 +0200
commitbe8ceae6e6c2836233dd8acedd829b18943f820a (patch)
treef625c58523ccee5c27c082c49e15c2d142d836fb /src/DecoderThread.cxx
parent67ae033de7e769067035f76c992e21d3616bf3fe (diff)
downloadmpd-be8ceae6e6c2836233dd8acedd829b18943f820a.tar.gz
mpd-be8ceae6e6c2836233dd8acedd829b18943f820a.tar.xz
mpd-be8ceae6e6c2836233dd8acedd829b18943f820a.zip
Song: GetURI() returns std::string
Diffstat (limited to '')
-rw-r--r--src/DecoderThread.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/DecoderThread.cxx b/src/DecoderThread.cxx
index aacbb1fb7..4d0d008ca 100644
--- a/src/DecoderThread.cxx
+++ b/src/DecoderThread.cxx
@@ -422,16 +422,13 @@ decoder_run(struct decoder_control *dc)
dc->ClearError();
const Song *song = dc->song;
- char *uri;
-
assert(song != NULL);
- if (song->IsFile())
- uri = g_strdup(map_song_fs(song).c_str());
- else
- uri = song->GetURI();
+ const std::string uri = song->IsFile()
+ ? std::string(map_song_fs(song).c_str())
+ : song->GetURI();
- if (uri == NULL) {
+ if (uri.empty()) {
dc->state = DecoderState::ERROR;
dc->error.Set(decoder_domain, "Failed to map song");
@@ -439,8 +436,7 @@ decoder_run(struct decoder_control *dc)
return;
}
- decoder_run_song(dc, song, uri);
- g_free(uri);
+ decoder_run_song(dc, song, uri.c_str());
}