diff options
author | Uoti Urpala <uau@mplayer2.org> | 2012-07-02 02:35:57 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2012-07-16 21:08:42 +0300 |
commit | 2ba8b91a97e7e873a522f365e41a293af980c91a (patch) | |
tree | 40a17dd313350955ecdb285c06fbba005caa4ad9 /bstr.h | |
parent | 39a45c7a175acf7ef5546073f62f5b9b7f83a893 (diff) | |
download | mpv-2ba8b91a97e7e873a522f365e41a293af980c91a.tar.bz2 mpv-2ba8b91a97e7e873a522f365e41a293af980c91a.tar.xz |
build, codec-cfg.c: simplify builtin codecs.conf handling
The player can read codec mapping (codecs.conf) from an external file
or use embedded defaults. Before, the defaults were stored in the
player binary in the form of final already-parsed data structures.
Simplify things by storing the text of the codecs.conf file instead,
and parse that at runtime the same way an external file would be
parsed.
To create the previous parsed form, the build system first compiled a
separate binary named "codec-cfg", which parsed etc/codecs.conf and
then wrote the results as a C data structure that could be compiled
into the program. The new simple conversion of codecs.conf into a C
string is handled by the new script TOOLS/file2string.py.
After removing the codec-cfg binary, HOST_CC is no longer used for
anything. Remove the --host-cc configure option and associated logic.
Also remove the codec2html and codec-cfg-test functionality. Building
those was already broken and nobody cared.
There was a broken 3-character-long "fourcc" entry in etc/codecs.conf.
This happened to be accepted before but triggered a parse error after
the changes. Remove the broken entry and make the parsing functions
explicitly test for this error.
Diffstat (limited to 'bstr.h')
-rw-r--r-- | bstr.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -64,6 +64,7 @@ int bstrcspn(struct bstr str, const char *reject); int bstr_find(struct bstr haystack, struct bstr needle); struct bstr *bstr_splitlines(void *talloc_ctx, struct bstr str); +struct bstr bstr_getline(struct bstr str, struct bstr *rest); struct bstr bstr_lstrip(struct bstr str); struct bstr bstr_strip(struct bstr str); struct bstr bstr_split(struct bstr str, const char *sep, struct bstr *rest); @@ -135,6 +136,11 @@ static inline int bstr_find0(struct bstr haystack, const char *needle) return bstr_find(haystack, bstr(needle)); } +static inline int bstr_eatstart0(struct bstr *s, char *prefix) +{ + return bstr_eatstart(s, bstr(prefix)); +} + #endif // create a pair (not single value!) for "%.*s" printf syntax |