if (c->http_multiple == -1) {
uint8_t *http_version_opt = NULL;
- av_opt_get(v->input, "http_version", AV_OPT_SEARCH_CHILDREN, &http_version_opt);
- c->http_multiple = http_version_opt && strncmp((const char *)http_version_opt, "1.1", 3) == 0;
+ int r = av_opt_get(v->input, "http_version", AV_OPT_SEARCH_CHILDREN, &http_version_opt);
+ if (r >= 0) {
+ c->http_multiple = strncmp((const char *)http_version_opt, "1.1", 3) == 0;
+ av_freep(&http_version_opt);
+ }
}
seg = next_segment(v);
if (c->http_multiple == 1 && !v->input_next_requested &&
- seg && av_strstart(seg->url, "http", NULL)) {
+ seg && seg->key_type == KEY_NONE && av_strstart(seg->url, "http", NULL)) {
ret = open_input(c, v, seg, &v->input_next);
if (ret < 0) {
if (ff_check_interrupt(c->interrupt_callback))
return ret;
}
- if (c->http_persistent && av_strstart(seg->url, "http", NULL)) {
+ if (c->http_persistent &&
+ seg->key_type == KEY_NONE && av_strstart(seg->url, "http", NULL)) {
v->input_read_done = 1;
} else {
ff_format_io_close(v->parent, &v->input);