mirror of https://git.ffmpeg.org/ffmpeg.git
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: Steven Liu <lq@onvideo.cn>
This commit is contained in:
parent
03a9e6ff30
commit
805ce25b1d
|
@ -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,"
|
av_log(s, AV_LOG_WARNING, "Cannot use both -hls_key_info_file and -hls_enc,"
|
||||||
" will use -hls_key_info_file priority\n");
|
" will use -hls_key_info_file priority\n");
|
||||||
}
|
}
|
||||||
if (c->key_info_file) {
|
|
||||||
if ((err = hls_encryption_start(s)) < 0)
|
if (c->number <= 1) {
|
||||||
goto fail;
|
if (c->key_info_file) {
|
||||||
} else {
|
if ((err = hls_encryption_start(s)) < 0)
|
||||||
if ((err = do_encrypt(s)) < 0)
|
goto fail;
|
||||||
goto fail;
|
} else {
|
||||||
|
if ((err = do_encrypt(s)) < 0)
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ((err = av_dict_set(&options, "encryption_key", c->key_string, 0))
|
if ((err = av_dict_set(&options, "encryption_key", c->key_string, 0))
|
||||||
< 0)
|
< 0)
|
||||||
|
|
Loading…
Reference in New Issue