Commit 67bf4b44 authored by Max Kellermann's avatar Max Kellermann

added decoder_get_url()

The wavpack decoder plugin implements a hack, and it needs the song URL for that. This API (and the hack) should be revised later, but add that function for now.
parent c60209ff
...@@ -45,6 +45,11 @@ void decoder_initialized(struct decoder * decoder, ...@@ -45,6 +45,11 @@ void decoder_initialized(struct decoder * decoder,
notify_signal(&pc.notify); notify_signal(&pc.notify);
} }
const char *decoder_get_url(mpd_unused struct decoder * decoder, char * buffer)
{
return get_song_url(buffer, dc.current_song);
}
enum decoder_command decoder_get_command(mpd_unused struct decoder * decoder) enum decoder_command decoder_get_command(mpd_unused struct decoder * decoder)
{ {
return dc.command; return dc.command;
......
...@@ -103,6 +103,8 @@ void decoder_initialized(struct decoder * decoder, ...@@ -103,6 +103,8 @@ void decoder_initialized(struct decoder * decoder,
const AudioFormat * audio_format, const AudioFormat * audio_format,
float total_time); float total_time);
const char *decoder_get_url(struct decoder * decoder, char * buffer);
enum decoder_command decoder_get_command(struct decoder * decoder); enum decoder_command decoder_get_command(struct decoder * decoder);
/** /**
......
...@@ -456,7 +456,7 @@ static int wavpack_streamdecode(struct decoder * decoder, InputStream *is) ...@@ -456,7 +456,7 @@ static int wavpack_streamdecode(struct decoder * decoder, InputStream *is)
* As we use dc.utf8url, this function will be bad for * As we use dc.utf8url, this function will be bad for
* single files. utf8url is not absolute file path :/ * single files. utf8url is not absolute file path :/
*/ */
utf8url = get_song_url(tmp, dc.current_song); utf8url = decoder_get_url(decoder, tmp);
if (utf8url == NULL) { if (utf8url == NULL) {
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment