[FFmpeg-devel] [PATCH 1/2] Icecast: always send a content-type

epirat07 at gmail.com epirat07 at gmail.com
Tue Nov 11 02:19:33 CET 2014


From: Marvin Scholz <epirat07 at gmail.com>

use a default (audio/mpeg for historical reason) if none. Required since Icecast 2.4.1
---
 libavformat/icecast.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavformat/icecast.c b/libavformat/icecast.c
index 7d60e44..d7a2d18 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,7 @@ 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);
     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