[FFmpeg-devel] Fwd: Re: [PATCH 4/4] avformat/hlsenc: add http options to m3u8 hlsenc
Karthick Jeyapal
kjeyapal at akamai.com
Tue Dec 19 06:04:11 EET 2017
On 12/18/17 2:17 PM, Steven Liu wrote:
> Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
> ---
> libavformat/hlsenc.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 0cb75ff198..636b7db183 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -1723,6 +1723,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
> int stream_index = 0;
> int range_length = 0;
> uint8_t *buffer = NULL;
> + AVDictionary *options = NULL;
> VariantStream *vs = NULL;
>
> for (i = 0; i < hls->nb_varstreams; i++) {
> @@ -1835,7 +1836,8 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
> }
>
> if (hls->segment_type == SEGMENT_TYPE_FMP4) {
> - ret = hlsenc_io_open(s, &vs->out, vs->avf->filename, NULL);
> + set_http_options(s, &options, hls);
> + ret = hlsenc_io_open(s, &vs->out, vs->avf->filename, &options);
av_dict_free() call for options needs to be added here
> if (ret < 0) {
> av_log(NULL, AV_LOG_ERROR, "Failed to open file '%s'\n",
> vs->avf->filename);
> @@ -1899,6 +1901,7 @@ static int hls_write_trailer(struct AVFormatContext *s)
> HLSContext *hls = s->priv_data;
> AVFormatContext *oc = NULL;
> AVFormatContext *vtt_oc = NULL;
> + AVDictionary *options = NULL;
> char *old_filename = NULL;
> int i;
> int ret = 0;
> @@ -1916,7 +1919,8 @@ static int hls_write_trailer(struct AVFormatContext *s)
> }
> if ( hls->segment_type == SEGMENT_TYPE_FMP4) {
> int range_length = 0;
> - ret = hlsenc_io_open(s, &vs->out, vs->avf->filename, NULL);
> + set_http_options(s, &options, hls);
> + ret = hlsenc_io_open(s, &vs->out, vs->avf->filename, &options);
av_dict_free() call for options needs to be added here
> if (ret < 0) {
> av_log(NULL, AV_LOG_ERROR, "Failed to open file '%s'\n", vs->avf->filename);
> return AVERROR(ENOENT);
More information about the ffmpeg-devel
mailing list