From cdfeb30444e0021aa95f5d5e97dac7e60d3e8066 Mon Sep 17 00:00:00 2001 From: Karl Heyes Date: Wed, 23 Apr 2008 00:32:20 +0000 Subject: [PATCH] handle new content-types svn path=/icecast/trunk/icecast/; revision=14786 --- src/format.c | 6 +++++- src/format_ogg.c | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/format.c b/src/format.c index bc78c039..415391c4 100644 --- a/src/format.c +++ b/src/format.c @@ -60,6 +60,10 @@ format_type_t format_get_type (const char *contenttype) return FORMAT_TYPE_OGG; /* Backwards compatibility */ else if(strcmp(contenttype, "application/ogg") == 0) return FORMAT_TYPE_OGG; /* Now blessed by IANA */ + else if(strcmp(contenttype, "audio/ogg") == 0) + return FORMAT_TYPE_OGG; + else if(strcmp(contenttype, "video/ogg") == 0) + return FORMAT_TYPE_OGG; else /* We default to the Generic format handler, which can handle many more formats than just mp3 */ @@ -203,13 +207,13 @@ int format_check_http_buffer (source_t *source, client_t *client) { DEBUG0("processing pending client headers"); - client->respcode = 200; if (format_prepare_headers (source, client) < 0) { ERROR0 ("internal problem, dropping client"); client->con->error = 1; return -1; } + client->respcode = 200; stats_event_inc (NULL, "listeners"); stats_event_inc (NULL, "listener_connections"); stats_event_inc (source->mount, "listener_connections"); diff --git a/src/format_ogg.c b/src/format_ogg.c index 42b9cee2..64cd0801 100644 --- a/src/format_ogg.c +++ b/src/format_ogg.c @@ -170,7 +170,9 @@ int format_ogg_get_plugin (source_t *source) plugin->create_client_data = create_ogg_client_data; plugin->free_plugin = format_ogg_free_plugin; plugin->set_tag = NULL; - plugin->contenttype = "application/ogg"; + if (strcmp (httpp_getvar (source->parser, "content-type"), "application/x-ogg") == 0) + httpp_setvar (source->parser, "content-type", "application/ogg"); + plugin->contenttype = httpp_getvar (source->parser, "content-type"); ogg_sync_init (&state->oy);