aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-04 19:09:34 +0100
committerMax Kellermann <max@duempel.org>2009-01-04 19:09:34 +0100
commitfed719197c7014151710c4aae9174990fd131d59 (patch)
tree0fb6d6f69aa60ecdf9eb89286f8354316fffcc92 /src/player_thread.c
parentea8ae68e6f1a686fd96530fdaf7b428e33f58ec4 (diff)
downloadmpd-fed719197c7014151710c4aae9174990fd131d59.tar.gz
mpd-fed719197c7014151710c4aae9174990fd131d59.tar.xz
mpd-fed719197c7014151710c4aae9174990fd131d59.zip
song: allocate the result of song_get_url()
Diffstat (limited to 'src/player_thread.c')
-rw-r--r--src/player_thread.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index acaf7e123..98cc64441 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -178,13 +178,15 @@ static void player_process_command(struct player *player)
if (openAudioDevice(NULL)) {
pc.state = PLAYER_STATE_PLAY;
} else {
- char tmp[MPD_PATH_MAX];
+ char *uri = song_get_uri(dc.next_song);
+ g_warning("problems opening audio device "
+ "while playing \"%s\"", uri);
+ g_free(uri);
+
assert(dc.next_song == NULL || dc.next_song->url != NULL);
pc.errored_song = dc.next_song;
pc.error = PLAYER_ERROR_AUDIO;
- g_warning("problems opening audio device "
- "while playing \"%s\"",
- song_get_url(dc.next_song, tmp));
+
player->paused = true;
}
}
@@ -335,13 +337,14 @@ static void do_play(void)
/* the decoder is ready and ok */
player.decoder_starting = false;
if (!openAudioDevice(&dc.out_audio_format)) {
- char tmp[MPD_PATH_MAX];
+ char *uri = song_get_uri(dc.next_song);
+ g_warning("problems opening audio device "
+ "while playing \"%s\"", uri);
+ g_free(uri);
+
assert(dc.next_song == NULL || dc.next_song->url != NULL);
pc.errored_song = dc.next_song;
pc.error = PLAYER_ERROR_AUDIO;
- g_warning("problems opening audio device "
- "while playing \"%s\"",
- song_get_url(dc.next_song, tmp));
break;
}