summaryrefslogtreecommitdiffstats
path: root/misc/bstr.c
Commit message (Collapse)AuthorAgeFilesLines
* misc/bstr: add bstr_to_wchar for win32Kacper Michajłow9 days1-0/+20
| | | | Convenience to avoid strlen above other things.
* bstr: remove unused bstr_splitlines() functionwm42019-12-231-22/+0
|
* Use mp_log2() instead of av_log2()wm42019-10-311-3/+1
|
* Replace uses of FFMIN/MAX with MPMIN/MAXwm42019-10-311-7/+7
| | | | And remove libavutil includes where possible.
* vo_opengl: support loading custom user texturesNiklas Haas2017-07-271-0/+37
| | | | | | | | | | | Parsing the texture data as raw strings makes the textures the most portable and self-contained. In order to facilitate different types of shaders, the parse_user_shader interaction has been changed to instead have it loop through blocks and call the passed functions for each valid block parsed. This is more modular and also cleaner, with better code separation. Closes #4586.
* bstr: change to LGPLwm42016-12-111-7/+7
| | | | | | | | Was started by Uoti Urpala in commit 5f631d1c. Although it was made part of demux_mkv.c, it's quite obvious that it's not based on any pre-existing demux_mkv.c code (or ebml.c/.h for that matter). Anyone else who has touched this code every since has already agreed to LGPL relicensing.
* vo_opengl: use RPN expressions for user hook sizesNiklas Haas2016-05-151-2/+10
| | | | | | | | | This replaces the previous TRANSFORM by WIDTH, HEIGHT and OFFSET where WIDTH and HEIGHT are RPN expressions. This allows for more fine-grained control over the output size, and also makes sure that overwriting existing textures works more cleanly. (Also add some more useful bstr functions)
* bstr: avoid redundant vsnprintf callswm42016-03-231-3/+9
| | | | | | | | | | | | | | | | | Until now, bstr_xappend_vasprintf() called vsnprintf() always twice: once to determine how much output the call would produce, and a second time to actually output the data to the (possibly resized) target memory. Change this so that it tries to output to the already allocated memory first, and repeat the call only if allocation is required. This is especially helpful, as bstr_xappend_vasprintf() is designed to avoid reallocation when building strings. Usually, the second vsnprintf() will happen only at the beginning, when the buffer hasn't been extended to his largest needed size yet. Not sure if there is a need to optimize this; but see the next commit.
* mpv_talloc.h: rename from talloc.hDmitrij D. Czarkoff2016-01-111-1/+1
| | | | This change helps avoiding conflict with talloc.h from libtalloc.
* Update license headersMarcin Kurczewski2015-04-131-5/+4
| | | | Signed-off-by: wm4 <wm4@nowhere>
* Silence some Coverity warningswm42014-11-211-1/+1
| | | | None of this really matters.
* bstr: don't call memcpy(..., NULL, 0)wm42014-11-211-0/+2
| | | | | | This is clearly not allowed, although it's not a problem on most libcs. Found by Coverity.
* bstr: check strings before memcmp/strncasecmpJames Ross-Gowan2014-10-071-2/+6
| | | | | | | | | bstr.start can be NULL when bstr.len is 0, so don't call memcmp or strncasecmp if that's the case. Passing NULL to string functions is invalid C, even when the length is 0, and it causes Windows to raise an invalid parameter error. Should fix #1155
* Move compat/ and bstr/ directory contents somewhere elsewm42014-08-291-0/+437
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.