Mercurial > mplayer.hg
annotate subopt-helper.h @ 15205:19243f85e164
nico partially fixed the bug i reported; here's the rest of the fix.
basically demux_audio was mixing data in its header buffer in a bogus
manner, whereby it could sometimes "make up" valid mpeg headers where
no such header actually occurred in the file. it should be correct now.
btw these changes also fix the bug where mplayer reports huge initial
cpu usage for sound when playing mp3 files.
author | rfelker |
---|---|
date | Sun, 17 Apr 2005 17:17:52 +0000 |
parents | 2ef20aa3623b |
children | 7e4fa8fc255c |
rev | line source |
---|---|
14281 | 1 #ifndef SUBOPT_HELPER_H |
2 #define SUBOPT_HELPER_H | |
3 | |
4 /** | |
5 * \file subopt-helper.h | |
6 * | |
7 * \brief Datatype and functions declarations for usage | |
8 * of the suboption parser. | |
9 * | |
10 */ | |
11 | |
12 #define OPT_ARG_BOOL 0 | |
13 #define OPT_ARG_INT 1 | |
14 #define OPT_ARG_STR 2 | |
14538
00c3c4111017
New suboption type: malloc'ed, zero terminated string
reimar
parents:
14285
diff
changeset
|
15 #define OPT_ARG_MSTRZ 3 ///< A malloced, zero terminated string, use free()! |
14281 | 16 |
14285 | 17 typedef int (*opt_test_f)(void *); |
18 | |
14281 | 19 /** simple structure for defining the option name, type and storage location */ |
20 typedef struct opt_s | |
21 { | |
22 char * name; ///< string that identifies the option | |
23 int type; ///< option type as defined in subopt-helper.h | |
24 void * valp; ///< pointer to the mem where the value should be stored | |
14285 | 25 opt_test_f test; ///< argument test func ( optional ) |
14281 | 26 int set; ///< Is set internally by the parser if the option was found. |
27 ///< Don't use it at initialization of your opts, it will be | |
28 ///< overriden anyway! | |
29 } opt_t; | |
30 | |
31 /** parses the string for the options specified in opt */ | |
32 int subopt_parse( char const * const str, opt_t * opts ); | |
33 | |
34 | |
35 /*------------------ arg specific types and declaration -------------------*/ | |
36 typedef struct strarg_s | |
37 { | |
14538
00c3c4111017
New suboption type: malloc'ed, zero terminated string
reimar
parents:
14285
diff
changeset
|
38 int len; ///< length of the string determined by the parser |
14281 | 39 char const * str; ///< pointer to position inside the parse string |
40 } strarg_t; | |
41 | |
14736 | 42 |
43 int int_non_neg( int * i ); | |
44 int int_pos( int * i ); | |
45 | |
14281 | 46 #endif |