提交 805ce25b 编写于 作者: S Steven Liu

avformat/hlsenc: improve hls encrypt get key file operation

get key file only once time is ok, no need more times.
Ticket-id: #6545

Found-by: JohnPi
Signed-off-by: NSteven Liu <lq@onvideo.cn>
上级 03a9e6ff
......@@ -1223,12 +1223,15 @@ static int hls_start(AVFormatContext *s)
av_log(s, AV_LOG_WARNING, "Cannot use both -hls_key_info_file and -hls_enc,"
" will use -hls_key_info_file priority\n");
}
if (c->key_info_file) {
if ((err = hls_encryption_start(s)) < 0)
goto fail;
} else {
if ((err = do_encrypt(s)) < 0)
goto fail;
if (c->number <= 1) {
if (c->key_info_file) {
if ((err = hls_encryption_start(s)) < 0)
goto fail;
} else {
if ((err = do_encrypt(s)) < 0)
goto fail;
}
}
if ((err = av_dict_set(&options, "encryption_key", c->key_string, 0))
< 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册