annotate av_opts.c @ 26699:f64717dfd9d5

Add newlines at end of file, this is required for text files and gcc also complains that they are missing.
author reimar
date Sun, 11 May 2008 10:35:30 +0000
parents e456af9908f8
children 41f8ba327cf5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26691
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
1 #include <stdlib.h>
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
2 #include <string.h>
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
3 #include "libavcodec/opt.h"
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
4
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
5 int parse_avopts(void *v, char *str){
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
6 char *start;
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
7 start= str= strdup(str);
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
8
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
9 while(str && *str){
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
10 char *next_opt, *arg;
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
11
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
12 next_opt= strchr(str, ',');
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
13 if(next_opt) *next_opt++= 0;
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
14
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
15 arg = strchr(str, '=');
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
16 if(arg) *arg++= 0;
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
17
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
18 if(!av_set_string(v, str, arg)){
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
19 free(start);
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
20 return -1;
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
21 }
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
22 str= next_opt;
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
23 }
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
24
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
25 free(start);
e456af9908f8 AVOptions support.
michael
parents:
diff changeset
26 return 0;
26699
f64717dfd9d5 Add newlines at end of file, this is required for text files and gcc
reimar
parents: 26691
diff changeset
27 }