MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ff_tee_parse_slave_options

Function ff_tee_parse_slave_options

libavformat/tee_common.c:33–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31static const char *const slave_opt_delim = ":]"; /* must have the close too */
32
33int ff_tee_parse_slave_options(void *log, char *slave,
34 AVDictionary **options, char **filename)
35{
36 const char *p;
37 char *key, *val;
38 int ret;
39
40 if (!strspn(slave, slave_opt_open)) {
41 *filename = slave;
42 return 0;
43 }
44 p = slave + 1;
45 if (strspn(p, slave_opt_close)) {
46 *filename = (char *)p + 1;
47 return 0;
48 }
49 while (1) {
50 ret = av_opt_get_key_value(&p, "=", slave_opt_delim, 0, &key, &val);
51 if (ret < 0) {
52 av_log(log, AV_LOG_ERROR, "No option found near \"%s\"\n", p);
53 goto fail;
54 }
55 ret = av_dict_set(options, key, val,
56 AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
57 if (ret < 0)
58 goto fail;
59 if (strspn(p, slave_opt_close))
60 break;
61 p++;
62 }
63 *filename = (char *)p + 1;
64 return 0;
65
66fail:
67 av_dict_free(options);
68 return ret;
69}

Callers 2

open_slaveFunction · 0.85
tee_openFunction · 0.85

Calls 4

av_opt_get_key_valueFunction · 0.85
av_logFunction · 0.85
av_dict_setFunction · 0.85
av_dict_freeFunction · 0.85

Tested by

no test coverage detected