From patchwork Sun Feb 2 22:01:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 17671 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id CDE3C4494B1 for ; Mon, 3 Feb 2020 00:02:09 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AB1AC68809C; Mon, 3 Feb 2020 00:02:09 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CC57C687FBC for ; Mon, 3 Feb 2020 00:02:03 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 8CCC2E3DE6; Sun, 2 Feb 2020 23:02:03 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2lIIQV_JHSbD; Sun, 2 Feb 2020 23:02:01 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 98ED4E3DCB; Sun, 2 Feb 2020 23:02:01 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Feb 2020 23:01:56 +0100 Message-Id: <20200202220156.16568-1-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 Subject: [FFmpeg-devel] [PATCH] avformat/dashenc: use AV_OPT_TYPE_DICT for http_opts X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This changes the separator character from comma to colon, but since this option was only added recently I think it should be done for consistency with other similar options. Signed-off-by: Marton Balint --- doc/muxers.texi | 3 ++- libavformat/dashenc.c | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/muxers.texi b/doc/muxers.texi index 05bf483ba5..ef5c4b10bc 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -345,7 +345,8 @@ prft boxes in the underlying muxer. Applicable only when the @var{utc_url} optio Set one or more manifest profiles. @item -http_opts @var{http_opts} -List of options to pass to the underlying HTTP protocol. Applicable only for HTTP output. +A :-separated list of key=value options to pass to the underlying HTTP +protocol. Applicable only for HTTP output. @item -target_latency @var{target_latency} Set an intended target latency in seconds (fractional value can be set) for serving. Applicable only when @var{streaming} and @var{write_prft} options are enabled. diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 3b651b9514..9a8dde98e9 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -167,7 +167,7 @@ typedef struct DASHContext { const char *utc_timing_url; const char *method; const char *user_agent; - char *http_opts; + AVDictionary *http_opts; int hls_playlist; int http_persistent; int master_playlist_created; @@ -479,8 +479,7 @@ static void set_http_options(AVDictionary **options, DASHContext *c) { if (c->method) av_dict_set(options, "method", c->method, 0); - if (c->http_opts) - av_dict_parse_string(options, c->http_opts, "=", ",", 0); + av_dict_copy(options, c->http_opts, 0); if (c->user_agent) av_dict_set(options, "user_agent", c->user_agent, 0); if (c->http_persistent) @@ -2273,7 +2272,7 @@ static const AVOption options[] = { { "mpd_profile", "Set profiles. Elements and values used in the manifest may be constrained by them", OFFSET(profile), AV_OPT_TYPE_FLAGS, {.i64 = MPD_PROFILE_DASH }, 0, UINT_MAX, E, "mpd_profile"}, { "dash", "MPEG-DASH ISO Base media file format live profile", 0, AV_OPT_TYPE_CONST, {.i64 = MPD_PROFILE_DASH }, 0, UINT_MAX, E, "mpd_profile"}, { "dvb_dash", "DVB-DASH profile", 0, AV_OPT_TYPE_CONST, {.i64 = MPD_PROFILE_DVB }, 0, UINT_MAX, E, "mpd_profile"}, - { "http_opts", "HTTP protocol options", OFFSET(http_opts), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E }, + { "http_opts", "HTTP protocol options", OFFSET(http_opts), AV_OPT_TYPE_DICT, { .str = NULL }, 0, 0, E }, { "target_latency", "Set desired target latency for Low-latency dash", OFFSET(target_latency), AV_OPT_TYPE_DURATION, { .i64 = 0 }, 0, INT_MAX, E }, { NULL }, };