| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ass_set_fonts_dir() is supposed to enable all fonts in a specific
directory. The implementation for it was dropped with the commit
introducing the new fontselect code. Some users were relying on it, so
we need it back.
It used to be implemented using a single fontconfig call. But since this
has to work even if fontconfig support is not even compiled, a new
implementation is needed.
This commit adds very simple and low-effort support for it. It loads all
files into memory, and then lets the memory font code do the rest. A
more efficient implementation would be possible, for example by
implementing a new font provider, which serves get_data requests from
open file handles. Anyone who wants to do this is welcome to try, and
this commit is just the minimum to restore the lost feature.
|
|
|
|
|
|
|
|
|
| |
The timecode is a long long, but it is computed as a product whose
all multiplicands are (unsigned) ints and so effectively has the value
of an (unsigned) int. Fix this, and use the full long long range,
by explicitly making one of the first two multiplicands a long long.
Found by Coverity Scan.
|
|
|
|
| |
Reported by clang scan-build static analysis.
|
|
|
|
|
| |
Reported by clang scan-build static analysis. Also fix incorrect
return value in case of error.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Allow exactly one of these prefixes in header values:
0x, 0X, &h, &H. Note that "0x0xFFFFFF" is a correct value,
as the first 0x is consumed by the parser and the second by
the string-to-number conversion following strtol semantics.
* Allow arbitrary numbers of leading & and H
(and not h) in any order in override tag values.
* Reduce header values modulo 2**32 instead
of saturating them to LLONG_MIN/MAX.
* Saturate override tag values to INT32_MIN/MAX
rather than to LLONG_MIN/MAX.
* Don't fiddle with bytes in alpha override tag values.
(They can be outside of the 0..255 range.)
Also change the byte swapping code to be more sensible.
Fixes #80.
Fixes #145.
Fixes #178.
Also fixes our behavior in the case described in
https://code.google.com/p/xy-vsfilter/issues/detail?id=80.
|
|
|
|
|
|
|
| |
Fixes "[ARR] Musashi no Ken - 01 [AVC][5697986B].ssa", which has
timestamps like "00:02:30.85". It starts with 2 zeros instead of one,
which probably means it's an invalid file, but it's accepted by various
other parsers (VSFilter, MPlayer, vlc, ffmpeg).
|
|
|
|
|
|
|
|
|
|
| |
This was a check for the realloc() call, but the result was never
used in the success case - which makes no sense.
Doesn't really matter, because it's the legacy charset code which
hopefully is not used by anyone.
Found by Coverity.
|
|
|
|
|
|
|
|
|
|
| |
Use strndup() instead of malloc+copy.
Make all code deal with the possibility that ASS_Drawing.text can be
NULL (which can happen on allocation failure).
Skip fix_collisions() on malloc failure - the lines will overlap, but at
least libass won't crash.
|
|
|
|
| |
This is just a start and gets most easy ones.
|
| |
|
|
|
|
|
| |
Also replace strtocolor in ass_utils with string2color
from ass.c, because that is more useful everywhere now.
|
| |
|
|
|
|
|
|
|
| |
These aren't very useful for debugging due to the high volume of the log
output in problem cases. In fact, all they do is making the code slower
(the message callback can easily appear in the profiler output, even if
the callback doesn't actually print the messages).
|
|
|
|
| |
This reduces the frequency of reallocations.
|
|
|
|
| |
Obtained by reading the xy-VSFilter source code.
|
|
|
|
| |
This complements 5903771e.
|
|
|
|
| |
The "if (0) { // cool ;)" is just mindblowing.
|
|
|
|
|
|
| |
Based on the patch by chadr123.
See google code issue #113.
|
|
|
|
|
|
|
|
|
|
|
|
| |
ass_step_sub() assumed that the subtitle event list was sorted by event
start time, but that is not guaranteed. Making the list sorted is not
an option. (At least for now - too many issues are in the way to get
such a change being done.) Fix this function so that it works with an
unsorted event list.
Semantics regarding corner cases might be slightly different, such as
what happens if the now parameter coincides with event start/end, or
behavior with overlapping subtitles.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes google code issue #88.
process_text() garbles the memory as the text is parsed.
This also fixes that the user provided buffer implicitly had to
be null terminated. This wasn't obvious, because the caller
passes in the buffer length. libass ignored the buffer length
(unless a codepage was provided and iconv was enabled), and
happily read past the end of the buffer.
It would be much nicer if the parsing code would be fixed,
instead of just copying the input buffer. Maybe one day.
|
|
|
|
|
|
| |
Trim '*' from the start of style name fields of Style
and Dialogue lines and normalize the case of "Default"
in the style name field of Dialogue lines.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The value is parsed and stored as an enum constant that the consumer
can read from ASS_Track. All output images are still plain RGB,
and the consumer is expected to perform its own color correction.
Supported header values: (TV|PC).(601|709|240M|FCC) and None.
If the header is missing, a special compatibility value is used
that should be treated as TV.601 if the accompanying video stream
is YCbCr and as None otherwise. If the header is present but has
an invalid/unknown value, a different special value is substituted.
|
|
|
|
|
| |
Useful when applications specify the style manually for non-ASS
subtitles.
|
|
|
|
| |
Fixes issue 83.
|
|
|
|
|
|
| |
Similar to VSFilter. Thanks to Iroha for reporting this issue.
Note: this breaks the ABI!
|
| |
|
|
|
|
|
| |
This allows to reset to a certain style, instead of the default style
for the current line. For some reason, this was completely missing.
|
|
|
|
|
|
| |
Parse a hint in the form "Language: xx" with xx being an ISO 639-1
language code, and pass it to HarfBuzz. This can be useful to render
scripts with language-specific character variants.
|
| |
|
|
|
|
| |
Use 50% alpha for the shadow. Looks nicer and is just like VSFilter.
|
|
|
|
| |
VSFilter always matches style names case sensitive.
|
|
|
|
|
|
| |
Make the "Default" style, useful as a fallback and required by few
scripts for proper rendering, actually do something sensible. Font,
sizes, et cetera are set up mostly like VSFilter.
|
|
|
|
|
|
| |
In hope to make libass as useful as possible, relicense libass to ISC, a
simplified 2-clause BSD license. All contributors who provided
non-trivial changes have granted their permission for this.
|
|
|
|
|
| |
The useless "if (foo) free(foo)" idiom is all over the place, just
get rid of it finally...
|
| |
|
| |
|
|
|
|
|
| |
strcasecmp/strncasecmp needs strings.h according to POSIX, so add this
include where these occur.
|
|
|
|
| |
Limit context printed after parsing errors to 30 characters
|
|
|
|
|
|
| |
Add a function to flush all events in a track and increment
LIBASS_VERSION to indicate the addition.
Initial patch by Aurelien Jacobs (aurel AT gnuage DOT org).
|
|
|
|
|
|
| |
Do not skip '@' at the start of a font name in styles; detect '@' at
font name start and set a new attribute in ASS_Font accordingly.
Rotate affected glyphs after loading and calculate a suitable advance.
|
|
|
|
|
|
| |
If an application wants to provide some sort of safeguard against
loading very big files (which can trash memory), it should do so by
itself.
|
|
|
|
|
|
| |
Change size limit from 10MB to 50MB and clean up code a bit. A limit
still might be handy if one selects a very big file for subtitles by
accident. 50MB should be enough for even the biggest karaoke files.
|
| |
|
|
|
|
| |
Patch by Arne Morten Kvarving <spiff@micron.(none)>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Kerning causes problems with many (broken) fonts. VSFilter doesn't use
kerning so these problems won't be apparant, while libass uses kerning
by default.
For compatibility reasons, disable kerning by default. In addition,
make it configurable through style overrides and the Script Info
header.
I.e. put "Kerning: yes" into the Script Info header to enable kerning.
With MPlayer, using "-ass-force-style Kerning=yes" will always
enable kerning.
This also includes a minor ABI change for tracking the kerning boolean.
As this only affects code that creates or modifies ASS_Tracks manually,
and I'm not aware of anyone doing that, the SONAME will not be bumped.
|
|
|
|
|
|
| |
According to the ASS specification, colors can only be specified in hex.
Modify the color parsing accordingly; this especially means that colors
where the hex sigil (the "H") is missing can now be parsed.
|
|
|
|
|
|
| |
Rename all typedefs from the convention foo_bar_t, which can possibly
conflict with POSIX types, to FooBar (and ASS_FooBar for public
API typedefs). Fix formatting and stray comments while at it.
|
|
|
|
|
| |
Remove useless _s suffix from struct names and remove struct name where
not needed (only the typedef'd struct is used). Clean up API headers.
|
|
|
|
|
| |
When freeing a track, also free the track name and the track itself.
Leak found by valgrind/memcheck.
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce functionality for providing a message callback that is used
for passing messages to the controlling application instead of simply
printing them to standard output. The function pointer to the callback
is stored in the ass_library_t instance. ass_msg needs access to it, so
in many places the library instance needs to be passed around now.
The default behavior is the old one: messages of MSGL_INFO or lower
are printed to the standard output, prefixed with "[ass]".
|
|
|
|
|
|
| |
Instead of referencing string defines from help_mp.h, use the strings
directly in ass_msg. Consequently, help_mp.h is useless and can
be deleted.
|
|
|
|
|
|
|
|
| |
libass didn't properly initialize its idea about the event format
specification (the Format: line in the [Events] section) in case none
was explicitly specified. This ends in a crash due to access to a null
pointer. It was changed so that the event format is initialized to
a reasonable default, the way it is also done for embedded subtitles.
|
|
|
|
|
|
| |
read_file_recode is only used internally in ass_read_file and
shouldn't be exposed in the API. Remove the prototype from ass.h
and declare it static.
|
|
|
|
|
| |
Rename process_force_style to ass_process_force_style and make it
available in the DSO.
|
| |
|
|
|
|
|
| |
Rename a few functions to avoid symbol clashes.
Clean up mputils.h.
|
| |
|
|
|
|
| |
A variable was needlessly static, this has been corrected.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reindent complete source code (*.c, *.h) with indent, the exact command
line being:
indent -kr -i4 -bap -nut -l76 *.c *.h
From now on, new code should use (more or less) K&R style,
only spaces and no tabs, 4 spaces indent width. Avoid long lines.
Fix function declaration pointer spacing.
Remove spaces that were added to many function declarations by indent,
like some_func(foo_t * bar).
Fix indenting of macros in ass.c
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28935 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28821 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28820 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27531 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
|
|
|
| |
conforming to the ASS spec
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27530 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
|
|
|
| |
Switch them from a HAVE_ to a CONFIG_ prefix.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27425 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
|
|
|
| |
CONFIG_ prefix for configurable options, HAVE_ for system-dependent stuff.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27391 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
|
|
|
|
| |
Replace all USE_ prefixes by CONFIG_ prefixes to indicate
options which are configurable.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27373 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
|
|
|
| |
This is just for readability, the code behaviour is not changed.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26924 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26923 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26922 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26839 b3059339-0415-0410-9bf9-f77b7e298cf2
|