err |= ffurl_close(nodes[i].uc);
av_freep(&data->nodes);
- av_freep(&h->priv_data);
return err < 0 ? -1 : 0;
}
int64_t size;
size_t len, i;
URLContext *uc;
- struct concat_data *data;
+ struct concat_data *data = h->priv_data;
struct concat_nodes *nodes;
av_strstart(uri, "concat:", &uri);
- /* creating data */
- if (!(data = av_mallocz(sizeof(*data))))
- return AVERROR(ENOMEM);
- h->priv_data = data;
-
for (i = 0, len = 1; uri[i]; i++)
if (uri[i] == *AV_CAT_SEPARATOR)
/* integer overflow */
}
if (!(nodes = av_malloc(sizeof(*nodes) * len))) {
- av_freep(&h->priv_data);
return AVERROR(ENOMEM);
} else
data->nodes = nodes;
uri += len + strspn(uri+len, AV_CAT_SEPARATOR);
/* creating URLContext */
- if ((err = ffurl_open(&uc, node_uri, flags)) < 0)
+ if ((err = ffurl_open(&uc, node_uri, flags,
+ &h->interrupt_callback, NULL)) < 0)
break;
/* creating size */
- if ((size = url_filesize(uc)) < 0) {
+ if ((size = ffurl_size(uc)) < 0) {
ffurl_close(uc);
err = AVERROR(ENOSYS);
break;
}
URLProtocol ff_concat_protocol = {
- "concat",
- concat_open,
- concat_read,
- NULL,
- concat_seek,
- concat_close,
+ .name = "concat",
+ .url_open = concat_open,
+ .url_read = concat_read,
+ .url_seek = concat_seek,
+ .url_close = concat_close,
+ .priv_data_size = sizeof(struct concat_data),
};