summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ci/gha: speed up MacOS buildsOneric2021-03-261-8/+0
| | | | | | | By not caching at all. Now that we're no longer using `brew update`, caching is barely doing anything, but causes some problems when the cache is not newer than GHA's preinstalled stuff.
* Do not apply \fsp to vector drawingsOleg Oshmyan2021-03-251-3/+5
| | | | | | This matches VSFilter. Fixes https://github.com/libass/libass/issues/487.
* be_padding: pad enough for intermediate states, not only resultOleg Oshmyan2021-03-051-3/+1
|
* Fix crash on empty stringsDr.Smile2021-02-241-0/+3
| | | | | | Our hash function doesn't handle zero-length buffers, but it was not a problem until 82b225b3d6653091d028b39d561d185ed76a7be5. Found by OSS-Fuzz.
* x86: update x86incRyan Lucia2021-02-233-277/+545
| | | | This should fix the warnings introduced with nasm 2.15
* cache: replace memcpy() in key move functions with assignmentDr.Smile2021-02-221-20/+23
|
* parsing: use string references for font family and drawing textDr.Smile2021-02-229-76/+77
| | | | That eliminates most uses of strdup() in the rendering process.
* Move ASS_FontDesc to generic cache infrastructureDr.Smile2021-02-223-33/+7
|
* configure: Remove superfluous commaOneric2021-02-221-1/+1
| | | | AC_LANG_PROGRAMM only takes two parameters.
* configure: Replace obsolete macrosOneric2021-02-221-3/+1
| | | | | | | | | | | | | | AC_CONFIG_HEADER has been replaced with AC_CONFIG_HEADERS for a long time and recent version of autotools started complaining about it. AC_HEADER_STDC has been deemed "obsolescent" and unneeded for "new programs" since at least autotools 2.60, which was released 2006. On top of it we're not even using its output variable anywhere to check if the system headers do in fact conform to the C standard, so remove this superfluous test. AC_HEADER_STDBOOL is not obsolecent, but simalarly to AC_HEADER_STDC we never use its output anywhere, so it can be removed as well.
* configure: correct NASM-configuration on 32bit BSDOneric2021-02-221-1/+9
| | | | | | | | | This patch was adapted from FreeBSD: https://svnweb.freebsd.org/ports/head/multimedia/libass/files/patch-configure.ac?view=markup and was also applied in DragonFlyBSD (eventhough DragonFlyBSD dropped 32bit support in 2014) closes https://github.com/libass/libass/issues/451
* configure: respect user-LIBS while locating system libsOneric2021-02-221-4/+1
| | | | | | | | | | | | | This allows to eg supply an alternative math library via LIBS="-lmymath" ./configure (in case the system has a seperate libm) This also means user-supplied LIBS now end up in our pc's Libs.private, which is probably correct for most cases. In case this assumptions turns out to be wrong and your reading this after bisecting some obscure error, well sorry about that. To exclude user-LIBS from pkg_libs again, eg save OLDLIBS="$LIBS" before and then set pkg_libs="${LIBS#$OLDLIBS}" after locating system libs.
* pc: use private and public fileds according to specOneric2021-02-222-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Libs.* are to be used for libraries not supplying a pc-file, eg system libs, while Requires.* is meant for libraries which do supply a *.pc-file. The public version of those fields is only to be used for libs whose symbols end up being exposed by our lib, by eg including one of their headers in our own headers. Those libs must be linked to both for dynamic and static builds. The private versions are not directly exposed to users of our lib and will only be linked to if an static build is requested. Those libs don't need to be linked for dynamic builds, but _will_ be linked in static builds. This also has implications for package maintainers, see eg https://lists.debian.org/debian-devel-announce/2005/11/msg00016.html . The intent in 7393996cfe0136f130a6a23bb9fb6f4ddce82d87, seems to have been making this static/dynamic build distinction ourselves. However this is both a needless complication in our config script as pkg-config already handles this, and prone to fail as requesting a static build is required anyway to get the *.private link flags of our dependencies as well. The correct way to handle a static build is to request one, eg one way to do this for an executable built with autotools and pkg-config is: LDFLAGS="-static" PKG_CONFIG="/usr/bin/pkg-config --static" ./configure
* configure: restyle everythingOneric2021-02-221-117/+138
| | | | | | - Prefer Autotool's M4-macros over raw shell constructs - Consistent indents - Always quote variables in test expressions
* configure: let USE_ICONV depend on a usable iconv.hOneric2021-02-151-10/+12
| | | | | | | | The result of the stdint.h check is neither used in the config script nor the code; remove the superfluous stdint-h check. As we do not use AC_CHECK_HEADERS (not-)found-callbacks or its additional includes, AC_CHECK_HEADERS_ONCE is sufficient and a tad faster; replace AC_CHECK_HEADERS with AC_CHECK_HEADERS_ONCE.
* configure: remove unused programsOneric2021-02-151-2/+0
| | | | | | We don't use the C-preprocessor standalone and manually choose and configure NASM as our assembler, so there's no need to let autotools search for CPP and an assembler.
* ci: add Coverity to GHAOneric2021-02-141-0/+88
| | | | | | | | | | | | | | | | | | We need to run Coverity on a clang build, because Coverity's gcc misreports its version causing ASS_DEPRECATED_ENUM version checks to falsely suceed, which then causes the build to fail. Coverity's clang likely also misreports its version, but whatever clang build Coverity is using happens to work with our current code. Coverity's gcc failing: https://travis-ci.org/github/libass/libass/builds/743655400 Coverity's clang succeeding: https://travis-ci.org/github/libass/libass/builds/740511824 Also Coverity's travis script is borked and always returns an error even on success, because it expects Coverity's server to respond with code 201, but they actually return 200 instead. To get meaningful job status we are using a custom script based on Coverity's upstream script and fontforge's Coverity script.
* ci: cache Homebrew files on MacOSOneric2021-02-141-0/+8
| | | | | This commit is adapted from mpv and should speed up MacOS builds. https://github.com/mpv-player/mpv/commit/3586ef77f31c9e0d396b0356a4054d57cbd146cb
* ci: add GitHubActions as CI platformOneric2021-02-141-0/+50
| | | | | | | | | travis-ci.org will close on 31.12.2020, and travis-ci.com's free plan does not include MacOS builds, therefore we need an alternative. Unfortunately, I couldn't find a way to get IRC notifications with GitHubActions and Coverity is also missing in GHA atm, so for now Travis still remains.
* ass_render: fix aliasing when 1a=0 but 3a>0rcombs2021-02-132-1/+3
|
* Travis CI: encrypt notification channel name to avoid fork spamOleg Oshmyan2021-02-061-1/+2
|
* Travis CI: run Coverity Scan only in one job per buildOleg Oshmyan2021-02-061-7/+5
| | | | | | | | | | | | Specifically, this is (currently) the Linux clang job. Due to issues with Coverity's gcc build, we cannot use a gcc build for this atm. To elaborate, Coverity's gcc apparently misreports its version, leading to compiler errors due to an false positive in ASS_DEPRECATED_ENUM macro's version check, as can be observed here: https://travis-ci.org/github/libass/libass/jobs/743655402 Coverity's clang build likely does so as well, but whatever clang build is used happens to already support everything we need.
* Travis CI: don't run ./configure twiceOleg Oshmyan2021-02-061-1/+0
|
* Travis CI: use make -j2Oleg Oshmyan2021-02-061-2/+2
| | | | | | https://docs.travis-ci.com/user/speeding-up-the-build/#makefile-optimization and https://docs.travis-ci.com/user/reference/overview/#virtualisation-environment-vs-operating-system suggest -j2 should be optimal on all VMs.
* Travis CI: use before_script and split commandsOleg Oshmyan2021-02-061-2/+3
| | | | | | | | | | The sequence is before_install -> install -> before_script -> script. `install` is supposed to be the one where dependencies are installed, but apparently the apt and homebrew plugins do it earlier. I'm not sure why the docs suggest putting `apt-get install` in `before_install`, but we no longer even do that. It definitely seems like the wrong stage for `./autogen.sh` and `./configure`, even if it currently affects nothing in practice.
* Travis CI: rename old `matrix` key to current `jobs`Oleg Oshmyan2021-02-061-1/+1
|
* Travis CI: remove obsolete `sudo` keyOleg Oshmyan2021-02-061-1/+0
| | | | We don't even use sudo since commit fb7731c85daccc635bf67608d3f8e45d9b61d578.
* Travis CI: use official syntax for env varsOleg Oshmyan2021-02-061-1/+1
|
* fontselect: warn when no fallback can be foundrcombs2021-01-161-0/+3
|
* docs: fix simple typo, ouline -> outlineTim Gates2020-12-181-1/+1
| | | | | | There is a small typo in libass/ass_outline.h. Should read `outline` rather than `ouline`.
* configure: Fix --enable-large-tilesOneric2020-11-131-2/+2
| | | | | | Due to a misplaced comma this config switch was broken. A follow-up commit will change our autoconf-style in a way, that should make it harder for errors like this one to slip in.
* configure: use AC_SEARCH_LIBS instead of AC_CHECK_LIBOneric2020-11-131-1/+6
| | | | | | | | | | | This avoids unneccessary -lm flags on some platforms integrating libm into libc and allows us to detect systems that do not provide implementations of math functions in either libc or libm. The caveat is, that some systems, like FreeBSD split their math functions between libc and libm. By checking for C99 lrint instead of C89 fabs, this check correctly includes libm in FreeBSD; let's hope this also holds for other systems splitting up their math.h implementations.
* configure: remove unnecessary CXXFLAGSOneric2020-11-131-1/+0
| | | | | | | Those were added in commit 29fd129671bb66a2e54717ca666b6ccd7f7ee941 together with the initial DirectWrite implementation, which was in C++. As of 1c55ca966f356030a863479459055c48e98ed1e5 our DirectWrite implementation is C, so CXXFLAGS are no longer needed.
* configure: Explain iconv-check logicOneric2020-11-131-0/+4
| | | | | | | | | | Commit 8bebabe4a62a6d54cdfecace59c382efa80a8e47 apparently added the libiconv_open check to support libraries like GNU libiconv defining their iconv-functions as a macro expanding to lib*. As this i not immediately obvious, add an explaining comment. Additionally AC_SEARCH_LIBS will first try to link the ptrogramm with only the current $LIBS and not add anything to $LIBS if that already succeeds, thus avoiding adding '-liconv' twice.
* configure: Don't add iconv to pkg_libs a second timeOneric2020-11-131-8/+4
| | | | | | | | | This seems to have erronously slipped in again with commit 5ab9950816ffcac46afec4ad327640ab28a49109. It was previously addded in commmit e572a26d29ddff883880ef7b1c295acaa62a8a2f when all libs were still added manually and shortly after removed again in commit 4b6a81eb4fd79198ceef813418aaa938190624ba, which switched to generating pkg_libs from LIBS.
* configure: Reoder configuration logicOneric2020-11-131-137/+150
| | | | | This should make this a bit easier to understand and more readable. Apart from comments nothing was removed or added, just reodered.
* autotools: Set automake flavour on AM_INITOneric2020-11-052-2/+1
|
* configure: add Haiku NASM supportOneric2020-11-051-2/+13
| | | | | | And print an error on attempts to use ASM on an unrecognized system as NASM would very likely produce borked files anyway. (erroring out can still be avoided with --disable-asm)
* ass_library: Constify ass_add_fontHugo Beauzée-Luyssen2020-11-013-3/+3
| | | | | Both parameters are copied and are immutable. Make it clear through the function prototype
* Treat zero-area events as explicitly positionedOneric2020-10-311-2/+4
| | | | | | | | | | | | | | | | | | | VSFilter does collision by calculating the intersection of two events rectangles and treating events as colliding iff their intersection has a non-zero area. As a consequence zero-area events cannot collide with anything. https://github.com/Cyberbeing/xy-VSFilter/blob/xy_sub_filter_rc4@%7B2020-05-17%7D/src/subtitles/RTS.cpp#L1627 libass does not do collision by intersection area, but because we ignore edge-edge intersections results are identical to VSFilter for non-zero-area events. To reconcile the results for zero-area events, treat them as explicitly positioned as they effectively are in VSFilter. This allows us to keep our (probably) faster collision code and saves us from unnecessary collsion checks for zero-area events. Fixes https://github.com/libass/libass/issues/444
* Don't carry xbord width across eventsOneric2020-10-311-0/+1
| | | | | | Since text_info is not re-initialised before every event, border_x could carry over to following events with a smaller \xbord value. This was broken in commmit 236bc18d39c080853d1145c7b978fb8f47e31deb
* ass_utils: round double_to_d* properlyOleg Oshmyan2020-10-291-3/+3
|
* shape_harfbuzz_process_run: round scaled positions properlyOleg Oshmyan2020-10-291-4/+4
|
* Match more types and format specifiers to size_t fontdata_usedOleg Oshmyan2020-10-281-2/+2
| | | | | | | | Omissions in commit 910211f1c0078e37546f73e95306724358b89be2. Microsoft's C library does not support %zu until Universal CRT (Visual Studio 2015). At worst, this verbose-level message will look wrong and be useless.
* decode_font: fix subtraction broken by change to unsigned typeOleg Oshmyan2020-10-271-2/+2
| | | | | | | | | | | This caused a one-byte buffer overwrite and an assertion failure. Regression in commit 910211f1c0078e37546f73e95306724358b89be2. Discovered by OSS-Fuzz. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26674. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26678.
* Release 0.15.00.15.0Oleg Oshmyan2020-10-275-6/+46
|
* Add missing file to MakefileOleg Oshmyan2020-10-271-1/+1
|
* Work around broken Travis CI macOS buildOleg Oshmyan2020-10-271-0/+1
| | | | | | Sigh. The Homebrew addon is broken with update: false (the default!). It has been fixed for osx_image: xcode11 and newer, but the default image is older.
* Fix \kf speed in anamorphic videoOleg Oshmyan2020-10-271-1/+2
|
* Speed up macOS Travis CI buildsOleg Oshmyan2020-10-271-1/+1
| | | | | | | | | Updating Homebrew takes more than 5 minutes. Upgrading other things that depend on FreeType takes more than 6 minutes. Together, that's 11+ minutes of build time gone to waste. It seems Homebrew in the current default osx image has all the dependencies we need without needing to update.
* Fix two freshly introduced memory leaks upon alloc failureOleg Oshmyan2020-10-271-7/+10
| | | | | | | Found by Coverity Scan. Fixes CID 303760. Fixes CID 303761.
* process_karaoke_effects: honor info->skip in \kf calculationsOleg Oshmyan2020-10-271-2/+8
| | | | This mainly affects trimmed trailing whitespace.
* Improve \kf position roundingOleg Oshmyan2020-10-273-9/+9
|
* Fix shifted \kf position with rectangular \iclipOleg Oshmyan2020-10-271-0/+1
|
* Fix \kf fill positioningOleg Oshmyan2020-10-274-6/+41
| | | | | | | | | | | | | | | | | | Our effect_timing is currently used as a coordinate relative to a weird origin: take each glyph's center within the run, apply 3D transforms, pick the leftmost one, and round it down a little. This makes no sense and is the result of an unrelated code change. But if I recall correctly, \kf positioning was already incorrect before that last change (but in a different manner). To fix this and hopefully to prevent this kind of error from occurring again, convert effect_timing to absolute screen coordinate. Start the fill at the glyph run's leftmost post-transform control point. This matches VSFilter and allows karaoke to work in vertical text (unlike, for example, starting the fill at the first glyph's pre-transform origin). Fixes https://github.com/libass/libass/issues/216. Fixes https://github.com/libass/libass/issues/357.
* process_karaoke_effects: fill from right to left if rotatedOleg Oshmyan2020-10-271-0/+10
| | | | This matches VSFilter.
* Delay angle conversion to radians until the last momentOleg Oshmyan2020-10-272-8/+9
| | | | | This allows decisions based on the angle values to be slightly more accurate and might save us a few flops.
* Handle \k0 \ko0 \kf0 \K0 like VSFilterOleg Oshmyan2020-10-272-4/+16
| | | | | | | | | | | | | Don't break runs when zero-duration karaoke starts unless the karaoke *type* differs. The zero-duration karaoke block ends up glued to the previous block (if any). In case of subsequent karaoke override tags, like {\k100\k0}, the intervening tags will advance the next karaoke block's start time, but not this combined block's start or end time. Of course, runs may still be broken in the same place if there's another reason for a run break besides karaoke, so zero-duration karaoke blocks can still occur. Run breaks that have no karaoke tags at all also still produce zero-duration karaoke blocks (if there is karaoke at all).
* process_karaoke_effects: use long long for timestampsOleg Oshmyan2020-10-271-3/+3
| | | | | | | | Our frame timestamps are long long. Don't truncate them to int here. This also avoids overflow in (tm_end - tm_start) if \k... tag arguments are big, although, of course, parse_tags still reads them in as doubles to begin with and their conversion from double may still be undefined.
* process_karaoke_effects: compute \kf from glyph advances, not boundsOleg Oshmyan2020-10-271-6/+2
| | | | Both ways make sense, but traditional VSFilter does it this way.
* Drop the now-useless, previously-broken first_pos_xOleg Oshmyan2020-10-272-5/+2
|
* process_karaoke_effects: place line at infinity except during \kfOleg Oshmyan2020-10-271-9/+8
| | | | Fixes \k and \ko in https://github.com/libass/libass/issues/357.
* process_karaoke_effects: reuse \kf logic for \k and \koOleg Oshmyan2020-10-271-15/+10
|
* process_karaoke_effects: explicitly handle edge cases for \kfOleg Oshmyan2020-10-271-2/+8
| | | | | | | In particular, don't divide by zero given \kf0. This fixes https://github.com/libass/libass/issues/124. The order is important: \kf accepts negative values.
* process_karaoke_effects: honor starts_new_runOleg Oshmyan2020-10-272-7/+13
| | | | | | | | | | | This matches VSFilter. In particular, compared to what we did before, karaoke blocks additionally end when an override tag changes something, as well as on any line break (after the trimmed leading whitespace on the new line) and after any trimmed leading whitespace on the first line. The text that follows the break has a zero karaoke duration, and its karaoke effect starts immediately after the karaoke effect ends for the block before the break.
* process_karaoke_effects: give the code a facelistOleg Oshmyan2020-10-271-50/+38
|
* Remove unused rot_key functionOleg Oshmyan2020-10-271-6/+0
| | | | Unused since commit c80f332798238731e1ddf1b541748f3d5c8030f3.
* Avoid passing NULL as a %s parameterOneric2020-10-271-1/+7
| | | | | ass_msg's callback will most likely use vprintf. Passing NULL as %s to a _printf function is undefined behaviour.
* Handle strdup-fails regardinging FontFamilyOneric2020-10-272-9/+19
| | | | | | | We already ensure at creation that all styles have a non-null FontName. However font family strings are strduped at various places and NULLs cannot be fully avoided, since already the very first font strdup may fail, so additional checks are required.
* Check for strdup_failures in process_styleOneric2020-10-271-3/+12
| | | | | | | We can't parse the style without a valid style_format. If strdup for FontName or Name or there fallback values fails, the style is of no use, so discard it. As the removal happens before any other styles are added, just decreasing n_styles is safe here.
* Check for strdup failures in process_event_tailOneric2020-10-271-3/+5
| |