[FFmpeg-devel] [PATCH] Fixes for the Icecast protocol

epirat07 at gmail.com epirat07 at gmail.com
Tue Nov 11 00:27:31 CET 2014


From: ePirat <epirat07 at gmail.com>

Send 100-continue header so we detect errors before sending data
Use a default content-type (content-type is required since Icecast 2.4.1)
---
 libavformat/icecast.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/icecast.c b/libavformat/icecast.c
index 7d60e44..b477528 100644
--- a/libavformat/icecast.c
+++ b/libavformat/icecast.c
@@ -60,7 +60,7 @@ static const AVOption options[] = {
     { "ice_public", "set if stream is public", OFFSET(public), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, E },
     { "user_agent", "override User-Agent header", OFFSET(user_agent), AV_OPT_TYPE_STRING, { 0 }, 0, 0, E },
     { "password", "set password", OFFSET(pass), AV_OPT_TYPE_STRING, { 0 }, 0, 0, E },
-    { "content_type", "set content-type, MUST be set if not audio/mpeg", OFFSET(content_type), AV_OPT_TYPE_STRING, { 0 }, 0, 0, E },
+    { "content_type", "set content-type, MUST be set if not audio/mpeg", OFFSET(content_type), AV_OPT_TYPE_STRING, { .str = "audio/mpeg" }, 0, 0, E },
     { "legacy_icecast", "use legacy SOURCE method, for Icecast < v2.4", OFFSET(legacy_icecast), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, E },
     { NULL }
 };
@@ -115,8 +115,8 @@ static int icecast_open(URLContext *h, const char *uri, int flags)
     av_dict_set(&opt_dict, "auth_type", "basic", 0);
     av_dict_set(&opt_dict, "headers", headers, 0);
     av_dict_set(&opt_dict, "chunked_post", "0", 0);
-    if (NOT_EMPTY(s->content_type))
-        av_dict_set(&opt_dict, "content_type", s->content_type, 0);
+    av_dict_set(&opt_dict, "content_type", s->content_type, 0);
+	av_dict_set(&opt_dict, "send_expect_100", "1", 0);
     if (NOT_EMPTY(s->user_agent))
         av_dict_set(&opt_dict, "user_agent", s->user_agent, 0);
 
-- 
2.1.0



More information about the ffmpeg-devel mailing list