Mercurial > mplayer.hg
annotate av_opts.c @ 26691:e456af9908f8
AVOptions support.
author | michael |
---|---|
date | Sat, 10 May 2008 18:54:10 +0000 |
parents | |
children | f64717dfd9d5 |
rev | line source |
---|---|
26691 | 1 #include <stdlib.h> |
2 #include <string.h> | |
3 #include "libavcodec/opt.h" | |
4 | |
5 int parse_avopts(void *v, char *str){ | |
6 char *start; | |
7 start= str= strdup(str); | |
8 | |
9 while(str && *str){ | |
10 char *next_opt, *arg; | |
11 | |
12 next_opt= strchr(str, ','); | |
13 if(next_opt) *next_opt++= 0; | |
14 | |
15 arg = strchr(str, '='); | |
16 if(arg) *arg++= 0; | |
17 | |
18 if(!av_set_string(v, str, arg)){ | |
19 free(start); | |
20 return -1; | |
21 } | |
22 str= next_opt; | |
23 } | |
24 | |
25 free(start); | |
26 return 0; | |
27 } |