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

Function parse_key_value_pair

libavutil/dict.c:186–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186static int parse_key_value_pair(AVDictionary **pm, const char **buf,
187 const char *key_val_sep, const char *pairs_sep,
188 int flags)
189{
190 char *key = av_get_token(buf, key_val_sep);
191 char *val = NULL;
192 int ret;
193
194 if (key && *key && strspn(*buf, key_val_sep)) {
195 (*buf)++;
196 val = av_get_token(buf, pairs_sep);
197 }
198
199 if (key && *key && val && *val)
200 ret = av_dict_set(pm, key, val, flags);
201 else
202 ret = AVERROR(EINVAL);
203
204 av_freep(&key);
205 av_freep(&val);
206
207 return ret;
208}
209
210int av_dict_parse_string(AVDictionary **pm, const char *str,
211 const char *key_val_sep, const char *pairs_sep,

Callers 1

av_dict_parse_stringFunction · 0.70

Calls 3

av_get_tokenFunction · 0.85
av_dict_setFunction · 0.85
av_freepFunction · 0.85

Tested by

no test coverage detected