| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
| |
Finds the start of the subtitle at "now".
|
| |
|
|
|
|
|
|
|
|
| |
Not all API users will keep the event list on seeking. This also gives
the opportunity to API users to handle severely broken files with
duplicate ReadOrder entries. (It is not known whether this is really
needed, however VSFilter does not deduplicate using the ReadOrder
field.)
|
|
|
|
|
|
| |
This was always the intention, but the wording could be read as if this
is not allowed. There was a bug that broke ass_flush_events() too, which
gives all the more reason to clarify this.
|
|
|
|
|
|
|
|
|
| |
It's always such a bother to write the changelog on release. And in
fact, there is no reason why the changelog should be written on release.
It's easier to edit it as we commit fixes or features.
I'm adding the changelog entries for the past two commits, and in the
future, we should add entries as we commit bug fixes or new features.
|
|
|
|
|
| |
Otherwise, ass_process_chunk() will reject events that were previously
removed with ass_flush_events(), which is nonsense.
|
| |
|
| |
|
|
|
|
|
| |
This avoids unnecessary work and fixes a memory leak:
the character set wasn't released when code == 0.
|
| |
|
|
|
|
|
|
|
| |
Return true on success and false on failure.
get_font_info was actually inconsistent, returning false both
on success and on failure due to the face not being scalable.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DirectWrite does not provide fast access to the is_postscript flag,
requiring each font to be loaded before its format can be determined.
Eagerly doing this for every installed font can be quite slow,
on the order of seconds.
To improve performance, ask the font provider for this information
only when it is actually needed, i.e. when one of the font's full
names or its PostScript name matches a requested font name and we
need to know whether to accept this match.
The return value of check_postscript is not cached in this commit.
This makes repeated calls slower than accessing is_postscript was.
This should not be a problem, but if it is, the value can be cached
(or precomputed) by font providers in their font private data.
This commit also potentially increases the memory usage of some
font providers by retaining data structures needed to implement
check_postscript in their font private data. This should not be
a problem either, but if it is, the value of check_postscript
can be precomputed by all providers other than DirectWrite.
|
|
|
|
|
|
|
|
|
|
| |
* Check malloc and calloc return values.
* Abort if a name can't be fetched, rather than supply a NULL
string to fontselect causing it to crash.
* Make sure to free all allocated memory.
* Always check FAILED(hr) before using the value of any output
argument returned by DirectWrite, because it is not clear whether
they are guaranteed to have correct values in case of error.
|
|
|
|
|
|
|
|
|
| |
* Metrics are not used, so don't fetch them.
* All variables except meta are always explicitly set before use,
so don't initialize them.
* Declare variables where they are used.
* Use int loop variables when the loop bound is int.
* Prefer post-increment to pre-increment.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This has the side effect that the ASS_FontProviderMetaData instance is now
cleared for every font rather than only once at the start of the search,
which fixes some use-after-free scenarios and prevents the creation of
chimeric fonts using names left over from other fonts processed earlier.
This lays the groundwork for further code simplification and error handling
improvements within this function, which will come in a separate commit.
This commit is transparent to `git blame -w` except for return statements.
|
|
|
|
|
| |
Keep all components signed, allowing for timestamps like 00:01:-05.00
to denote 55 seconds. This matches the behavior of VSFilter.
|
|
|
|
| |
Reported by gcc -Wall -Wextra.
|
|
|
|
|
|
|
| |
Some parts used in fontselect weren't properly defined.
v2: RAW_CFF face type was added later, so it's at the end of the
enum list.
|
|
|
|
|
|
|
|
| |
Fixing this properly involves constifying ASS_FontProviderMetaData
and refactoring code that allocates and frees strings stored in it.
This seems easy on the surface but turns out to be nontrivial when
you actually try to do it. This may still be done at a later date,
but for now, just add explicit casts.
|
|
|
|
|
| |
We need a newer Fontconfig than the default Ubuntu
environment provides, so switch to a newer Ubuntu.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This matches the behavior of GDI and hence VSFilter.
Note that \fn arguments are trimmed during parsing.
However, none of the names inside fonts should be trimmed,
and @-prefixed fonts should keep whitespace following the @,
both of which this commit addresses.
Remove strdup_trimmed because it is no longer used. Also remove
the declaration of a function that was deleted a few months ago.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Related to commit e00691e8096cc69e5651480155ebc61d9e079290:
it turns out that GDI (and hence VSFilter) does not check full names of
fonts that have PostScript outlines when searching for a font by name.
To summarize the resulting behavior:
* Fonts with PostScript outlines can be found by family name
and by PostScript name.
* Fonts without PostScript outlines can be found by family name
and by full name.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Fonts without PostScript outlines (such as TrueType fonts) are unaffected,
and their PostScript names continue to be ignored when searching for fonts.
This matches the behavior of GDI and hence VSFilter.
|
|
|
|
|
|
|
| |
And fix two wrong comments.
Bump the Fontconfig version requirement to 2.10.92 (2.11 RC2), released
on 2013-03-29, to ensure Fontconfig caches and exposes PostScript names.
|
|
|
|
|
|
| |
Currently this affects only the verbose output in
ass_font_select, but it will become more useful when we
start matching against PostScript names in the future.
|
| |
|
|
|
|
| |
index is signed, and psname only overrides it iff index < 0.
|
| |
|
|
|
|
|
|
| |
Library checks can succeed if the needed functions exist in libc
and don't need any extra linker flags. Avoid adding unnecessary
flags (which break static linking against libass) in this case.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The loop in check_duplicate_event() essentially makes event processing
with ass_process_chunk() O(n^2). Using a bitmap instead of a loop brings
it back to O(n).
This could be interpreted as an API change: since the event list is
freely modifieable by the API user through ASS_Track public fields,
libass can't know if the internal bitmap went out of sync with the
public event list. We just redefine it so that calling
ass_process_chunk() means the API user agrees not to manipulate the
event list otherwise.
|
| |
|
| |
|
|
|
|
| |
Its only use was removed in commit b63d8931.
|
| |
|
| |
|
|
|
|
|
| |
The ass_func_template.h entry was removed with commit c22a4ff9.
utils.asm is really new.
|
|
|
|
|
| |
This was forgotten. We always load dwrite.dll at runtime, so this isn't
needed.
|
|
|
|
|
|
| |
As pointed out in #198. This is certainly just a typo.
Fixes #198.
|
|\
| |
| | |
Remove ENCA support
|
|/
|
|
|
|
|
|
|
|
|
| |
There is no real value in it. ENCA only works in some cases and I
can't find any information about software that integrates libass
which relies on it or users that rely on ENCA support in case the
interface is exposed directly (e.g. in MPlayer).
If there is still a wish to have charset detection integrated into
libass (it is out of scope, IMHO), a better library like uchardet
should be used for that.
|
|\
| |
| | |
MSVC/ICL and general header fixes
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As before, this does not add any build system support:
a config.h file and a project must still be manually created
(or the compiler can be run manually instead of using a project).
Signed-off-by: Grigori Goronzy <greg@kinoho.net>
Signed-off-by: Oleg Oshmyan <chortos@inbox.lv>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This way, #include "config.h" is consistently the very
first thing the compiler sees when compiling any file.
Some source files currently don't use anything defined in config.h,
but it's easier and less error-prone to include it now to anticipate
possible future changes in those files, config.h or other headers.
|
| | |
|
| | |
|
|/
|
|
| |
It was needed for UTF16BE -> UTF8 only, which is trivial to implement.
|
|
|
|
| |
WINBOOL is MingW-specific.
|
|
|
|
|
| |
MSVC requires the calling convention to be grouped with the identifier when
defining a callback type.
|
|
|
|
|
|
|
|
|
|
| |
This is more robust and simpler. The bearing calculations initially
were bugged, but getting rid of them completely seems better. It is
consistent with other text renderers as well. To simplify things, also
move striking before the additional scale is applied and get rid of the
half-pixel overlapping thing; it is not needed with additive blending.
Fixes #193.
|
|
|
|
|
| |
This seems to cause issues on MSVC. Considering that even most Unix OSes
hate PATH_MAX and don't really honour it, using 4096 is just as good.
|
|\
| |
| | |
NIH: add locale-independent string functions
|
|/
|
|
|
|
|
|
| |
OS or platform-specific locale independent functions are painful to
use and/or not available, so roll our own. Not great but the least
painful and least intrusive.
v2: fix indexing, use static inline
|
|
|
|
|
|
| |
Passing NULL as argument to %s format specifiers when using the printf
fasmily of functions is not allowed. While some libcs handle it, other
libcs will simply crash.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Also fixes the build on OSX under some circumstances (weird and
inconsistent rules for the inline keyword in C).
|
| |
|
| |
|
|
|
|
|
| |
MSGL_V is usually for far noisier messages, such as those printed per
subtitle event.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Another consequence of the trickiness in this code. This codepath for
opaque_box=1 assumes both bm_o and bm_g are set, but if memory
allocation fails somewhere, bm_o could be non-NULL, but bm_g NULL, which
then would result in a crash when accessing bm_g.
Possibly this code could be cleaned up to look much nicer (and not have
dozens of hidden, obscure bugs), but for now this fixes the potential
crash found by Coverity.
Fixes CID 146125.
|
|
|
|
| |
Fixes CID 146421.
|
| |
|
|
|
|
| |
Fixes CID 146124.
|
|
|
|
|
| |
Also move the argument parsing part to the top of the function. IT's
easier to read this way.
|
|
|
|
|
|
|
|
|
|
| |
The logic here is pretty complicated. The caller of this function guards
it with "if(info->bm || info->bm_o){", and generally indeed only one of
them is set. But in some cases, both are needed. fix_outline()
definitely dereferences both. This is not necessarily guaranteed, e.g.
on out of memory errors. Add the missing checks.
Fixes CID 146125.
|
|
|
|
| |
Bad things can happen otherwise. Found by coverity scan.
|
|
|
|
| |
Introduced by commit d6bb9af6. Found by coverity scan.
|
|\ |
|
| |\
| | |
| | | |
Substitutions and some fixes
|