hls: consistent use of user_agent
authorJan Berkel <jan@berkel.fr>
Fri, 17 Feb 2017 11:00:40 +0000 (12:00 +0100)
committerwm4 <nfxjfg@googlemail.com>
Thu, 23 Mar 2017 11:51:21 +0000 (12:51 +0100)
This came up while debugging a problem with mpv:
https://github.com/mpv-player/mpv/issues/4155

Signed-off-by: wm4 <nfxjfg@googlemail.com>
libavformat/hls.c

index c65a9f9e87b03c588f266827716638ced1a34fc0..bac53a43500fe870d70aa565ed99188df8a0880b 100644 (file)
@@ -670,7 +670,7 @@ static int parse_playlist(HLSContext *c, const char *url,
         av_dict_set(&opts, "seekable", "0", 0);
 
         // broker prior HTTP options that should be consistent across requests
-        av_dict_set(&opts, "user-agent", c->user_agent, 0);
+        av_dict_set(&opts, "user_agent", c->user_agent, 0);
         av_dict_set(&opts, "cookies", c->cookies, 0);
         av_dict_set(&opts, "headers", c->headers, 0);
         av_dict_set(&opts, "http_proxy", c->http_proxy, 0);
@@ -1084,7 +1084,7 @@ static int open_input(HLSContext *c, struct playlist *pls, struct segment *seg)
     int is_http = 0;
 
     // broker prior HTTP options that should be consistent across requests
-    av_dict_set(&opts, "user-agent", c->user_agent, 0);
+    av_dict_set(&opts, "user_agent", c->user_agent, 0);
     av_dict_set(&opts, "cookies", c->cookies, 0);
     av_dict_set(&opts, "headers", c->headers, 0);
     av_dict_set(&opts, "http_proxy", c->http_proxy, 0);
@@ -1623,7 +1623,7 @@ static int hls_read_header(AVFormatContext *s)
 
     if (u) {
         // get the previous user agent & set back to null if string size is zero
-        update_options(&c->user_agent, "user-agent", u);
+        update_options(&c->user_agent, "user_agent", u);
 
         // get the previous cookies & set back to null if string size is zero
         update_options(&c->cookies, "cookies", u);