提交 3e24af2e 编写于 作者: Z Zhang Rui

ijkavformat/ijksegment: simplify code

上级 1cbce550
......@@ -35,7 +35,7 @@ typedef struct Context {
/* options */
int64_t opaque;
int segment_index;
int async_http;
char *http_hook;
} Context;
static void *ijksegment_get_opaque(URLContext *h) {
......@@ -89,16 +89,10 @@ static int ijksegment_open(URLContext *h, const char *arg, int flags, AVDictiona
goto fail;
}
av_dict_set_int(options, "ijksegment-opaque", c->opaque, 0);
av_dict_set_int(options, "ijksegment-segment-index", c->segment_index, 0);
av_dict_set_int(options, "ijkinject-opaque", c->opaque, 0);
av_dict_set_int(options, "ijkinject-segment-index", c->segment_index, 0);
if (av_strstart(inject_data.url, "http://", NULL)) {
ret = ffurl_open(&c->inner, inject_data.url, flags, &h->interrupt_callback, options);
} else {
char async_url[4096] = "async:";
av_strlcat(async_url, inject_data.url, sizeof(async_url));
ret = ffurl_open(&c->inner, async_url, flags, &h->interrupt_callback, options);
}
ret = ffurl_open(&c->inner, inject_data.url, flags, &h->interrupt_callback, options);
if (ret)
goto fail;
......@@ -136,8 +130,6 @@ static const AVOption options[] = {
OFFSET(opaque), IJKAV_OPTION_INT64(0, INT64_MIN, INT64_MAX) },
{ "ijkinject-segment-index", "segment index of current url",
OFFSET(segment_index), IJKAV_OPTION_INT(0, 0, INT_MAX) },
{ "ijksegment-async-http", "add prefix async: to http stream",
OFFSET(async_http), IJKAV_OPTION_INT(0, 0, INT_MAX) },
{ NULL }
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册