[3/4] mms: Set http custom headers via the AVOption

Message ID 1320659572-8118-3-git-send-email-martin@martin.st
State Committed
Commit 27fad11b5b0d2ae48f3ffe0a88d012bc8cdf90df
Headers show

Commit Message

Martin Storsjö Nov. 7, 2011, 9:52 a.m.
---
I haven't been able to test this, due to lack of mmsh sample urls.

 libavformat/mmsh.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Comments

Martin Storsjö Nov. 8, 2011, 5:24 p.m. | #1
On Mon, 7 Nov 2011, Martin Storsjö wrote:

> ---
> I haven't been able to test this, due to lack of mmsh sample urls.

I got this tested later yesterday, thanks to Vladimir for the sample url.

// Martin
Anton Khirnov Nov. 8, 2011, 5:52 p.m. | #2
On Mon,  7 Nov 2011 11:52:51 +0200, Martin Storsjö <martin@martin.st> wrote:
> ---
> I haven't been able to test this, due to lack of mmsh sample urls.
> 
>  libavformat/mmsh.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 

Ok.

Patch

diff --git a/libavformat/mmsh.c b/libavformat/mmsh.c
index 0ce282c..cbce2f5 100644
--- a/libavformat/mmsh.c
+++ b/libavformat/mmsh.c
@@ -28,6 +28,7 @@ 
 #include <string.h>
 #include "libavutil/intreadwrite.h"
 #include "libavutil/avstring.h"
+#include "libavutil/opt.h"
 #include "internal.h"
 #include "mms.h"
 #include "asf.h"
@@ -245,7 +246,7 @@  static int mmsh_open(URLContext *h, const char *uri, int flags)
              CLIENTGUID
              "Connection: Close\r\n\r\n",
              host, port, mmsh->request_seq++);
-    ff_http_set_headers(mms->mms_hd, headers);
+    av_opt_set(mms->mms_hd->priv_data, "headers", headers, 0);
 
     err = ffurl_connect(mms->mms_hd);
     if (err) {
@@ -291,7 +292,7 @@  static int mmsh_open(URLContext *h, const char *uri, int flags)
         goto fail;
     }
     av_dlog(NULL, "out_buffer is %s", headers);
-    ff_http_set_headers(mms->mms_hd, headers);
+    av_opt_set(mms->mms_hd->priv_data, "headers", headers, 0);
 
     err = ffurl_connect(mms->mms_hd);
     if (err) {