}
av_dict_free(&options);
- if (oc->oformat->priv_class && oc->priv_data)
+ /* We only require one PAT/PMT per segment. */
+ if (oc->oformat->priv_class && oc->priv_data) {
+ char period[21];
+
+ snprintf(period, sizeof(period), "%d", (INT_MAX / 2) - 1);
+
av_opt_set(oc->priv_data, "mpegts_flags", "resend_headers", 0);
+ av_opt_set(oc->priv_data, "sdt_period", period, 0);
+ av_opt_set(oc->priv_data, "pat_period", period, 0);
+ }
- if (c->vtt_basename)
- avformat_write_header(vtt_oc,NULL);
+ if (c->vtt_basename) {
+ err = avformat_write_header(vtt_oc,NULL);
+ if (err < 0)
+ return err;
+ }
return 0;
fail:
{"round_durations", "round durations in m3u8 to whole numbers", 0, AV_OPT_TYPE_CONST, {.i64 = HLS_ROUND_DURATIONS }, 0, UINT_MAX, E, "flags"},
{"discont_start", "start the playlist with a discontinuity tag", 0, AV_OPT_TYPE_CONST, {.i64 = HLS_DISCONT_START }, 0, UINT_MAX, E, "flags"},
{"omit_endlist", "Do not append an endlist when ending stream", 0, AV_OPT_TYPE_CONST, {.i64 = HLS_OMIT_ENDLIST }, 0, UINT_MAX, E, "flags"},
- { "use_localtime", "set filename expansion with strftime at segment creation", OFFSET(use_localtime), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, E },
+ { "use_localtime", "set filename expansion with strftime at segment creation", OFFSET(use_localtime), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, E },
{"method", "set the HTTP method", OFFSET(method), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E},
{ NULL },