aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/httpd_output_plugin.c
diff options
context:
space:
mode:
authorViliam Mateicka <viliam.mateicka@gmail.com>2009-12-03 20:27:08 +0100
committerViliam Mateicka <viliam.mateicka@gmail.com>2009-12-03 20:27:08 +0100
commitac0bf1a445ab0d76b5d3c76b115552cfe4475ae0 (patch)
tree0fdddca708d3216cbc64631deb179e911aa2887a /src/output/httpd_output_plugin.c
parent7b80e738102db1cf2cacf1e5118f5d51caf38c76 (diff)
downloadmpd-ac0bf1a445ab0d76b5d3c76b115552cfe4475ae0.tar.gz
mpd-ac0bf1a445ab0d76b5d3c76b115552cfe4475ae0.tar.xz
mpd-ac0bf1a445ab0d76b5d3c76b115552cfe4475ae0.zip
httpd: use get_mime_type to determine encoder content
Diffstat (limited to 'src/output/httpd_output_plugin.c')
-rw-r--r--src/output/httpd_output_plugin.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/output/httpd_output_plugin.c b/src/output/httpd_output_plugin.c
index a1f8be73a..a54253351 100644
--- a/src/output/httpd_output_plugin.c
+++ b/src/output/httpd_output_plugin.c
@@ -117,13 +117,6 @@ httpd_output_init(G_GNUC_UNUSED const struct audio_format *audio_format,
return NULL;
}
- if (strcmp(encoder_name, "vorbis") == 0)
- httpd->content_type = "application/x-ogg";
- else if (strcmp(encoder_name, "lame") == 0)
- httpd->content_type = "audio/mpeg";
- else
- httpd->content_type = "application/octet-stream";
-
httpd->clients_max = config_get_block_unsigned(param,"max_clients", 0);
/* initialize listen address */
@@ -144,6 +137,12 @@ httpd_output_init(G_GNUC_UNUSED const struct audio_format *audio_format,
if (httpd->encoder == NULL)
return NULL;
+ /* determine content type */
+ httpd->content_type = encoder_get_mime_type(httpd->encoder);
+ if (httpd->content_type == NULL) {
+ httpd->content_type = "application/octet-stream";
+ }
+
httpd->mutex = g_mutex_new();
return httpd;