| 184 | } |
| 185 | |
| 186 | static 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 | |
| 210 | int av_dict_parse_string(AVDictionary **pm, const char *str, |
| 211 | const char *key_val_sep, const char *pairs_sep, |
no test coverage detected