- avio_printf(hls->pb, "#EXTM3U\n");
- avio_printf(hls->pb, "#EXT-X-VERSION:3\n");
- avio_printf(hls->pb, "#EXT-X-TARGETDURATION:%d\n", target_duration);
- avio_printf(hls->pb, "#EXT-X-MEDIA-SEQUENCE:%d\n",
- FFMAX(0, hls->number - hls->size));
+ avio_printf(out, "#EXTM3U\n");
+ avio_printf(out, "#EXT-X-VERSION:%d\n", hls->version);
+ if (hls->allowcache == 0 || hls->allowcache == 1) {
+ avio_printf(out, "#EXT-X-ALLOW-CACHE:%s\n", hls->allowcache == 0 ? "NO" : "YES");
+ }
+ avio_printf(out, "#EXT-X-TARGETDURATION:%"PRId64"\n",
+ av_rescale_rnd(target_duration, 1, AV_TIME_BASE,
+ AV_ROUND_UP));
+ avio_printf(out, "#EXT-X-MEDIA-SEQUENCE:%"PRId64"\n", sequence);
+
+ av_log(s, AV_LOG_VERBOSE, "EXT-X-MEDIA-SEQUENCE:%"PRId64"\n",
+ sequence);