aboutsummaryrefslogtreecommitdiffhomepage
path: root/common/common.h
Commit message (Collapse)AuthorAge
* audio/video: merge decoder return valuesGravatar wm42016-02-01
| | | | | | Will be helpful for the coming filter support. I planned on merging audio/video decoding, but this will have to wait a bit longer, so only remove the duplicate status codes.
* mpv_talloc.h: rename from talloc.hGravatar Dmitrij D. Czarkoff2016-01-11
| | | | This change helps avoiding conflict with talloc.h from libtalloc.
* common: add mp_tag_str() utility functionGravatar wm42016-01-11
|
* command: replace ROUND() with lrint()Gravatar wm42015-12-26
| | | | | lrint() pretty much does what ROUND() is supposed to do, but it's more precise.
* x11: query ICC profile based on center of windowGravatar Niklas Haas2015-04-29
| | | | | | | | | | Right now, the default behavior is to pick the numerically lowest screen ID that overlaps the window in any way - but this means that mpv will decide to pick an ICC profile in a pretty arbitrary way even if the window only overlaps another screen by a single pixel. The new behavior is to query it based on the center of the window instead.
* Update license headersGravatar Marcin Kurczewski2015-04-13
| | | | Signed-off-by: wm4 <wm4@nowhere>
* Do not call strerror()Gravatar wm42014-11-26
| | | | | | | | | | | | | | | | | | | | | | | | | ...because everything is terrible. strerror() is not documented as having to be thread-safe by POSIX and C11. (Which is pretty much bullshit, because both mandate threads and some form of thread-local storage - so there's no excuse why implementation couldn't implement this in a thread-safe way. Especially with C11 this is ridiculous, because there is no way to use threads and convert error numbers to strings at the same time!) Since we heavily use threads now, we should avoid unsafe functions like strerror(). strerror_r() is in POSIX, but GNU/glibc deliberately fucks it up and gives the function different semantics than the POSIX one. It's a bit of work to convince this piece of shit to expose the POSIX standard function, and not the messed up GNU one. strerror_l() is also in POSIX, but only since the 2008 standard, and thus is not widespread. The solution is using avlibc (libavutil, by its official name), which handles the unportable details for us, mostly. We avoid some pain.
* common: fix version variable declarationsGravatar wm42014-11-02
| | | | This was stupid.
* Move compat/ and bstr/ directory contents somewhere elseGravatar wm42014-08-29
| | | | | | | | | bstr.c doesn't really deserve its own directory, and compat had just a few files, most of which may as well be in osdep. There isn't really any justification for these extra directories, so get rid of them. The compat/libav.h was empty - just delete it. We changed our approach to API compatibility, and will likely not need it anymore.
* common: change MP_NOPTS_VALUE definitionGravatar wm42014-05-10
| | | | | | | | | Use the exact floating point value, instead of a broken integer constant. The expression calculating the constant probably relied on undefined behavior, because it left-shifts a negative value. This also changes the type of the constant to double, which is perfectly fine, and maybe better than an integer constant.
* common: change mp_snprintf_append semanticsGravatar wm42014-05-05
| | | | | | | | Make it more suitable for chaining. This means a function formatting a value to a string using a static buffer can work exactly like mp_snprintf_append itself. Also rename it to mp_snprintf_cat, because that's shorter.
* common: add mp_snprintf_append() utility functionGravatar wm42014-04-29
|
* common: add some helper macrosGravatar wm42014-03-07
|
* common: drop mp_append_utf8_buffer()Gravatar wm42013-12-30
|
* common: simplify and optimize string escape parsingGravatar wm42013-12-30
| | | | | | | | | | | This code is shared between input.conf parser and option parser. Until now, the performance didn't really matter. But I want to use this code for JSON parsing too, and since JSON will have to be parsed a lot, it should probably try to avoid realloc'ing too much. This commit moves parsing of C-style escaped strings into a common function, and allows using it in a way realloc can be completely avoided, if the already allocated buffer is large enough.
* Don't include version.h from make options.cGravatar wm42013-12-22
| | | | | | | | | I find this annoying. It's the reason common/version.c exists at all. options.c did this for the user agent, which contains the version number. Because not including version.h means you can't build the user agent and use it in mp_default_opts anymore, do something rather awkward in main.c to initialize the default user agent.
* Split mpvcore/ into common/, misc/, bstr/Gravatar wm42013-12-17