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

Timothy Gu timothygu99 at gmail.com
Tue Nov 11 00:56:39 CET 2014


Hi,

On Monday, November 10, 2014, <epirat07 at gmail.com> wrote:

> From: ePirat <epirat07 at gmail.com <javascript:;>>


Real name please.


>
> 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)


These are two unrelated changes and should therefore be split into two
patches.


> ---
>  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);


This change LGTM.


> +       av_dict_set(&opt_dict, "send_expect_100", "1", 0);


Not sure about this one.

Timothy


More information about the ffmpeg-devel mailing list