fix ticket: 8783

Signed-off-by: Steven Liu <l...@chinaffmpeg.org>
---
 libavformat/hlsenc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 1d816a61e6..cce6b2faa5 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -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)
-- 
2.25.0



_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to