@@ -1722,6 +1722,15 @@ static int hls_start(AVFormatContext *s, VariantStream *vs)
av_opt_set(oc->priv_data, "mpegts_flags", "resend_headers", 0);
}
if (c->flags & HLS_SINGLE_FILE) {
+ if (c->key_info_file || c->encrypt) {
+ av_dict_set(&options, "encryption_key", vs->key_string, 0);
+ av_dict_set(&options, "encryption_iv", vs->iv_string, 0);
+ vs->basename = av_asprintf("crypto:%s", oc->url);
+ if (!vs->basename) {
+ err = AVERROR(ENOMEM);
+ goto fail;
+ }
+ }
set_http_options(s, &options, c);
if ((err = hlsenc_io_open(s, &vs->out, vs->basename, &options)) < 0) {
if (c->ignore_io_errors)
fix ticket: 8783 Signed-off-by: Steven Liu <lq@chinaffmpeg.org> --- libavformat/hlsenc.c | 9 +++++++++ 1 file changed, 9 insertions(+)