]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/dashenc.c
avformat/hlsenc: allow a custom SDT and PAT period
[ffmpeg] / libavformat / dashenc.c
index f555f208a7f956a26a9b47ba8522d5bb89ed078a..9a8dde98e90f643a9e2070c1d440014c034abe6d 100644 (file)
@@ -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)
@@ -1883,7 +1882,7 @@ static int dash_flush(AVFormatContext *s, int final, int stream)
                                                                   st->time_base,
                                                                   AV_TIME_BASE_Q));
 
-        if (!os->muxer_overhead)
+        if (!os->muxer_overhead && os->max_pts > os->start_pts)
             os->muxer_overhead = ((int64_t) (range_length - os->total_pkt_size) *
                                   8 * AV_TIME_BASE) /
                                  av_rescale_q(os->max_pts - os->start_pts,
@@ -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 },
 };