From fed719197c7014151710c4aae9174990fd131d59 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Jan 2009 19:09:34 +0100 Subject: song: allocate the result of song_get_url() --- src/player_thread.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/player_thread.c') 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; } -- cgit v1.2.3