mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-27 09:43:34 +00:00
avformat/hls: support decryption AES128 fmp4 m3u8 list
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
This commit is contained in:
parent
e2921578c0
commit
9e61141905
@ -811,6 +811,27 @@ static int parse_playlist(HLSContext *c, const char *url,
|
|||||||
ff_parse_key_value(ptr, (ff_parse_key_val_cb) handle_init_section_args,
|
ff_parse_key_value(ptr, (ff_parse_key_val_cb) handle_init_section_args,
|
||||||
&info);
|
&info);
|
||||||
cur_init_section = new_init_section(pls, &info, url);
|
cur_init_section = new_init_section(pls, &info, url);
|
||||||
|
cur_init_section->key_type = key_type;
|
||||||
|
if (has_iv) {
|
||||||
|
memcpy(cur_init_section->iv, iv, sizeof(iv));
|
||||||
|
} else {
|
||||||
|
int seq = pls->start_seq_no + pls->n_segments;
|
||||||
|
memset(cur_init_section->iv, 0, sizeof(cur_init_section->iv));
|
||||||
|
AV_WB32(cur_init_section->iv + 12, seq);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key_type != KEY_NONE) {
|
||||||
|
ff_make_absolute_url(tmp_str, sizeof(tmp_str), url, key);
|
||||||
|
cur_init_section->key = av_strdup(tmp_str);
|
||||||
|
if (!cur_init_section->key) {
|
||||||
|
av_free(cur_init_section);
|
||||||
|
ret = AVERROR(ENOMEM);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cur_init_section->key = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (av_strstart(line, "#EXT-X-ENDLIST", &ptr)) {
|
} else if (av_strstart(line, "#EXT-X-ENDLIST", &ptr)) {
|
||||||
if (pls)
|
if (pls)
|
||||||
pls->finished = 1;
|
pls->finished = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user