diff mbox

[FFmpeg-devel] avformat/hlsenc: support http method for hls fmp4

Message ID 20180428034705.28508-1-lq@chinaffmpeg.org
State Accepted
Commit 50df4c958b641e3ee3114e1eb659a151d34d2ac1
Headers show

Commit Message

Liu Steven April 28, 2018, 3:47 a.m. UTC
fix ticket: 7160

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 libavformat/hlsenc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Liu Steven May 24, 2018, 3:56 a.m. UTC | #1
> On Apr 28, 2018, at 11:47, Steven Liu <lq@chinaffmpeg.org> wrote:
> 
> fix ticket: 7160
> 
> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
> ---
> libavformat/hlsenc.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index c27a66ea79..09478e7c45 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -2147,6 +2147,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
>     int range_length = 0;
>     uint8_t *buffer = NULL;
>     VariantStream *vs = NULL;
> +    AVDictionary *options = NULL;
> 
>     for (i = 0; i < hls->nb_varstreams; i++) {
>         vs = &hls->var_streams[i];
> @@ -2272,7 +2273,8 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
>                 }
>                 vs->size = range_length;
>             } else {
> -                ret = hlsenc_io_open(s, &vs->out, vs->avf->url, NULL);
> +                set_http_options(s, &options, hls);
> +                ret = hlsenc_io_open(s, &vs->out, vs->avf->url, &options);
>                 if (ret < 0) {
>                     av_log(s, AV_LOG_ERROR, "Failed to open file '%s'\n",
>                            vs->avf->url);
> -- 
> 2.15.1
> 

Pushed

Thanks
Steven
diff mbox

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index c27a66ea79..09478e7c45 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2147,6 +2147,7 @@  static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
     int range_length = 0;
     uint8_t *buffer = NULL;
     VariantStream *vs = NULL;
+    AVDictionary *options = NULL;
 
     for (i = 0; i < hls->nb_varstreams; i++) {
         vs = &hls->var_streams[i];
@@ -2272,7 +2273,8 @@  static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
                 }
                 vs->size = range_length;
             } else {
-                ret = hlsenc_io_open(s, &vs->out, vs->avf->url, NULL);
+                set_http_options(s, &options, hls);
+                ret = hlsenc_io_open(s, &vs->out, vs->avf->url, &options);
                 if (ret < 0) {
                     av_log(s, AV_LOG_ERROR, "Failed to open file '%s'\n",
                            vs->avf->url);