• Home
  • Raw
  • Download

Lines Matching refs:seg

894                 struct segment *seg;  in parse_playlist()  local
898 seg = av_malloc(sizeof(struct segment)); in parse_playlist()
899 if (!seg) { in parse_playlist()
904 memcpy(seg->iv, iv, sizeof(iv)); in parse_playlist()
907 memset(seg->iv, 0, sizeof(seg->iv)); in parse_playlist()
908 AV_WB64(seg->iv + 8, seq); in parse_playlist()
915 av_free(seg); in parse_playlist()
918 seg->key = av_strdup(tmp_str); in parse_playlist()
919 if (!seg->key) { in parse_playlist()
920 av_free(seg); in parse_playlist()
925 seg->key = NULL; in parse_playlist()
931 if (seg->key) in parse_playlist()
932 av_free(seg->key); in parse_playlist()
933 av_free(seg); in parse_playlist()
936 seg->url = av_strdup(tmp_str); in parse_playlist()
937 if (!seg->url) { in parse_playlist()
938 av_free(seg->key); in parse_playlist()
939 av_free(seg); in parse_playlist()
946 " set to default value to 1ms.\n", seg->url); in parse_playlist()
949 seg->duration = duration; in parse_playlist()
950 seg->key_type = key_type; in parse_playlist()
951 dynarray_add(&pls->segments, &pls->n_segments, seg); in parse_playlist()
954 seg->size = seg_size; in parse_playlist()
956 seg->url_offset = seg_offset; in parse_playlist()
960 seg->url_offset = 0; in parse_playlist()
964 seg->init_section = cur_init_section; in parse_playlist()
1015 static int read_from_url(struct playlist *pls, struct segment *seg, in read_from_url() argument
1021 if (seg->size >= 0) in read_from_url()
1022 buf_size = FFMIN(buf_size, seg->size - pls->cur_seg_offset); in read_from_url()
1137 struct segment *seg = current_segment(pls); in intercept_id3() local
1143 bytes = read_from_url(pls, seg, buf + *len, ID3v2_HEADER_SIZE - *len); in intercept_id3()
1164 int64_t maxsize = seg->size >= 0 ? seg->size : 1024*1024; in intercept_id3()
1195 if (read_from_url(pls, seg, pls->id3_buf + id3_buf_pos, remaining) != remaining) in intercept_id3()
1209 bytes = read_from_url(pls, seg, buf + *len, buf_size - *len); in intercept_id3()
1229 static int open_input(HLSContext *c, struct playlist *pls, struct segment *seg, AVIOContext **in) in open_input() argument
1238 if (seg->size >= 0) { in open_input()
1241 av_dict_set_int(&opts, "offset", seg->url_offset, 0); in open_input()
1242 av_dict_set_int(&opts, "end_offset", seg->url_offset + seg->size, 0); in open_input()
1246 seg->url, seg->url_offset, pls->index); in open_input()
1248 if (seg->key_type == KEY_NONE) { in open_input()
1249 ret = open_url(pls->parent, in, seg->url, &c->avio_opts, opts, &is_http); in open_input()
1250 } else if (seg->key_type == KEY_AES_128) { in open_input()
1252 if (strcmp(seg->key, pls->key_url)) { in open_input()
1254 if (open_url(pls->parent, &pb, seg->key, &c->avio_opts, opts, NULL) == 0) { in open_input()
1258 seg->key); in open_input()
1263 seg->key); in open_input()
1265 av_strlcpy(pls->key_url, seg->key, sizeof(pls->key_url)); in open_input()
1267 ff_data_to_hex(iv, seg->iv, sizeof(seg->iv), 0); in open_input()
1270 if (strstr(seg->url, "://")) in open_input()
1271 snprintf(url, sizeof(url), "crypto+%s", seg->url); in open_input()
1273 snprintf(url, sizeof(url), "crypto:%s", seg->url); in open_input()
1283 } else if (seg->key_type == KEY_SAMPLE_AES) { in open_input()
1301 if (ret == 0 && !is_http && seg->url_offset) { in open_input()
1302 int64_t seekret = avio_seek(*in, seg->url_offset, SEEK_SET); in open_input()
1304 …_LOG_ERROR, "Unable to seek to offset %"PRId64" of HLS segment '%s'\n", seg->url_offset, seg->url); in open_input()
1316 static int update_init_section(struct playlist *pls, struct segment *seg) in update_init_section() argument
1324 if (seg->init_section == pls->cur_init_section) in update_init_section()
1329 if (!seg->init_section) in update_init_section()
1332 ret = open_input(c, pls, seg->init_section, &pls->input); in update_init_section()
1340 if (seg->init_section->size >= 0) in update_init_section()
1341 sec_size = seg->init_section->size; in update_init_section()
1355 ret = read_from_url(pls, seg->init_section, pls->init_sec_buf, in update_init_section()
1362 pls->cur_init_section = seg->init_section; in update_init_section()
1433 struct segment *seg; in read_data() local
1503 seg = current_segment(v); in read_data()
1506 ret = update_init_section(v, seg); in read_data()
1516 ret = open_input(c, v, seg, &v->input); in read_data()
1539 seg = next_segment(v); in read_data()
1541 seg && seg->key_type == KEY_NONE && av_strstart(seg->url, "http", NULL)) { in read_data()
1542 ret = open_input(c, v, seg, &v->input_next); in read_data()
1562 seg = current_segment(v); in read_data()
1563 ret = read_from_url(v, seg, buf, buf_size); in read_data()
1574 seg->key_type == KEY_NONE && av_strstart(seg->url, "http", NULL)) { in read_data()