Icecast: Use 100-continue if possible for proper error handling
authorMarvin Scholz <epirat07@gmail.com>
Tue, 11 Nov 2014 01:10:22 +0000 (02:10 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 11 Nov 2014 13:57:46 +0000 (14:57 +0100)
Using 100-continue ffmpeg will only send data if the server confirms it,
so if there is an error with auth or mounpoint, this allows that it is
properly reported to the user. Else ffmpeg sends data and just quits at
some point without an error message.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/icecast.c

index 7472416bfc05753e11b00dd143f471513edafab3..973c0c26a245a73fae69e9ccc5d6dde22f0cc344 100644 (file)
@@ -119,6 +119,7 @@ static int icecast_open(URLContext *h, const char *uri, int flags)
         av_dict_set(&opt_dict, "content_type", s->content_type, 0);
     else
         av_dict_set(&opt_dict, "content_type", "audio/mpeg", 0);
+    av_dict_set(&opt_dict, "send_expect_100", s->legacy_icecast ? "0" : "1", 0);
     if (NOT_EMPTY(s->user_agent))
         av_dict_set(&opt_dict, "user_agent", s->user_agent, 0);