]> granicus.if.org Git - libass/log
libass
14 years agoUpdate documentation to reflect fontconfig changes
Grigori Goronzy [Tue, 9 Feb 2010 20:25:08 +0000 (21:25 +0100)]
Update documentation to reflect fontconfig changes

14 years agoRemove file size limit in ass_read_file
Grigori Goronzy [Sat, 6 Feb 2010 03:11:53 +0000 (04:11 +0100)]
Remove file size limit in ass_read_file

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.

14 years agoSimplify test program
Grigori Goronzy [Sat, 6 Feb 2010 03:04:50 +0000 (04:04 +0100)]
Simplify test program

Lots of unnecessary calls to setup functions can be removed.

14 years agoUse font scaling coefficient 1.0 by default
Grigori Goronzy [Sat, 6 Feb 2010 03:04:20 +0000 (04:04 +0100)]
Use font scaling coefficient 1.0 by default

14 years agoDo not try to render if fonts have not been configured
Grigori Goronzy [Sat, 6 Feb 2010 03:02:16 +0000 (04:02 +0100)]
Do not try to render if fonts have not been configured

14 years agoClarify that libass expects subtitle packets in Matroska format
Grigori Goronzy [Tue, 2 Feb 2010 02:47:06 +0000 (03:47 +0100)]
Clarify that libass expects subtitle packets in Matroska format

14 years agoUpdate ass_set_fonts_dir documentation
Grigori Goronzy [Mon, 1 Feb 2010 19:00:24 +0000 (20:00 +0100)]
Update ass_set_fonts_dir documentation

Now that libass never extracts fonts anymore, update documentation
accordingly.

14 years agoSkip border generation if glyph is collapsed
Grigori Goronzy [Thu, 21 Jan 2010 05:31:45 +0000 (06:31 +0100)]
Skip border generation if glyph is collapsed

If a character is completely collapsed in x or y direction (\fscx0,
\fscy0), the rasterizer will not generate any visible pixels. This also
means vsfilter will never draw any border in this case, since it works
on the pixel data. FreeType's stroker OTOH happily draws a border around
a character, no matter how collapsed it is. Emulate vsfilter's behavior
by skipping border generation if the glyph is collapsed.

14 years agoAdjust a few message levels and message texts
Grigori Goronzy [Mon, 18 Jan 2010 23:55:46 +0000 (00:55 +0100)]
Adjust a few message levels and message texts

14 years agoUp size limit for script files
Grigori Goronzy [Mon, 18 Jan 2010 23:42:22 +0000 (00:42 +0100)]
Up size limit for script files

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.

14 years agoFix a warning due to added constness
Grigori Goronzy [Tue, 12 Jan 2010 13:06:03 +0000 (14:06 +0100)]
Fix a warning due to added constness

14 years agoFix leftovers from conversion to ass_strtod
Yuriy M. Kaminskiy [Tue, 12 Jan 2010 05:22:27 +0000 (08:22 +0300)]
Fix leftovers from conversion to ass_strtod

14 years agoConstify table in ass_strtod
Yuriy M. Kaminskiy [Tue, 12 Jan 2010 05:20:58 +0000 (08:20 +0300)]
Constify table in ass_strtod

14 years agoRemove support for freetype < 2.2.1
Grigori Goronzy [Fri, 8 Jan 2010 17:23:34 +0000 (18:23 +0100)]
Remove support for freetype < 2.2.1

Get rid of compatibility #ifdefs and some code to support very old
versions of freetype. libass now requires at least version 2.2.1.

14 years agoRemove support for fontconfig < 2.4.2
Grigori Goronzy [Fri, 8 Jan 2010 17:00:17 +0000 (18:00 +0100)]
Remove support for fontconfig < 2.4.2

Get rid of compatibility code and #ifdefs for very old fontconfig
versions.  libass now requires at least version 2.4.2.

14 years agoUse conversion functions to generate cache keys
Grigori Goronzy [Wed, 6 Jan 2010 22:58:05 +0000 (23:58 +0100)]
Use conversion functions to generate cache keys

Use the fixed-point conversion functions instead of (slightly incorrect)
manual conversion.

14 years agoImprove rotation cache accuracy
Grigori Goronzy [Wed, 6 Jan 2010 22:51:01 +0000 (23:51 +0100)]
Improve rotation cache accuracy

In some cases 16.16 precision is not good enough. Instead use 10.22 and
use modulo 360.0 on the angles to make overflows impossible and improve
cache hit ratio sometimes.

14 years agoDon't flag for freeing if codepage is unspecified
Grigori Goronzy [Wed, 6 Jan 2010 09:44:23 +0000 (10:44 +0100)]
Don't flag for freeing if codepage is unspecified

Patch by Arne Morten Kvarving <spiff@micron.(none)>.

14 years agoReset clip_mode on new events
Grigori Goronzy [Mon, 4 Jan 2010 18:54:19 +0000 (19:54 +0100)]
Reset clip_mode on new events

Make sure that the clip mode is reset to regular on new events.
Otherwise events after an event that used inverse clip will also use
inverse clip. Ouch! Usually the symptom is that subtitles become
invisible as the whole screen is clipped.

14 years agoReplace strtod with locale-independent strtod
Grigori Goronzy [Sun, 3 Jan 2010 13:54:02 +0000 (14:54 +0100)]
Replace strtod with locale-independent strtod

strtod respects the locale and in some locales, the decimal separator is
not a point, leading to parsing errors in tags like \pos(23.4,5), which
are perfectly valid.
As there isn't a really portable way to use a particular locale just for
one call to strtod, reimplement it. The implementation was taken from
the 1.8 branch of Ruby.

14 years agoautogen: cosmetics, overwrite files
Grigori Goronzy [Sun, 3 Jan 2010 12:48:32 +0000 (13:48 +0100)]
autogen: cosmetics, overwrite files

14 years agoFix minor typo
Grigori Goronzy [Sun, 11 Oct 2009 08:05:20 +0000 (10:05 +0200)]
Fix minor typo

14 years agoFix libass w/o fontconfig
Grigori Goronzy [Sun, 11 Oct 2009 07:07:26 +0000 (09:07 +0200)]
Fix libass w/o fontconfig

Make sure that libass does not crash even if no default font is
provided.  Additionally, fix crashes related to drawings in this and
possibly other unusual cases.

Document the default_path and default_family parameters of
ass_set_fonts.

14 years agostrdup() fontconfig strings freed by caller
Grigori Goronzy [Thu, 8 Oct 2009 21:55:23 +0000 (23:55 +0200)]
strdup() fontconfig strings freed by caller

fontconfig_select() can return the path to the default font as fallback,
but the caller frees it later.  Return a copy with strdup() instead.

14 years agoRemove superfluous cast
Grigori Goronzy [Thu, 8 Oct 2009 21:35:06 +0000 (23:35 +0200)]
Remove superfluous cast

14 years agoFix alpha calculation in some cases
Grigori Goronzy [Fri, 2 Oct 2009 02:12:03 +0000 (04:12 +0200)]
Fix alpha calculation in some cases

Picked up from XBMC svn.  This should especially fix MPlayer's direct3d
video output (untested).

14 years agoDisable test program and libpng by default 0.9.8
Grigori Goronzy [Thu, 17 Sep 2009 23:45:38 +0000 (01:45 +0200)]
Disable test program and libpng by default

14 years agoBump version to 0.9.8
Grigori Goronzy [Thu, 17 Sep 2009 23:33:44 +0000 (01:33 +0200)]
Bump version to 0.9.8

14 years agoUpdate changelog
Grigori Goronzy [Fri, 11 Sep 2009 02:12:38 +0000 (04:12 +0200)]
Update changelog

14 years agoRefactor: effect parsing should be in ass_parse.c
Grigori Goronzy [Fri, 11 Sep 2009 02:02:00 +0000 (04:02 +0200)]
Refactor: effect parsing should be in ass_parse.c

Move the function apply_transition_effects, which parses event-global
effects and adjusts a few state variables, into ass_parse.c.

14 years agoCopy shadow bitmap from glyph bitmap
Grigori Goronzy [Thu, 10 Sep 2009 09:08:21 +0000 (11:08 +0200)]
Copy shadow bitmap from glyph bitmap

It's not necessary to create the shadow bitmap by adding the glyph
bitmap to the outline bitmap; the outline is a superset of the glyph.

14 years agoRender NBSP (\h) as normal space
Grigori Goronzy [Thu, 10 Sep 2009 02:47:21 +0000 (04:47 +0200)]
Render NBSP (\h) as normal space

Many fonts don't have a non-breaking space (NBSP) character and this
can cause problems when these glyphs are substituted.  Render them
like a regular space.

15 years agoDisable kerning by default and make it configurable
Grigori Goronzy [Tue, 8 Sep 2009 20:21:43 +0000 (22:21 +0200)]
Disable kerning by default and make it configurable

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.

15 years agoFix inline function prototypes
Grigori Goronzy [Wed, 2 Sep 2009 03:59:27 +0000 (05:59 +0200)]
Fix inline function prototypes

15 years agoRefactor: move event parsing code into separate file
Grigori Goronzy [Tue, 1 Sep 2009 21:15:48 +0000 (23:15 +0200)]
Refactor: move event parsing code into separate file

Move all code related to parsing event lines and processing override
tags into a separate file (ass_parse.c).

15 years agoFix underrun in slant pen correction
Grigori Goronzy [Tue, 1 Sep 2009 11:31:04 +0000 (13:31 +0200)]
Fix underrun in slant pen correction

15 years agoHandle illegal \a tags like VSFilter
Grigori Goronzy [Tue, 1 Sep 2009 01:09:17 +0000 (03:09 +0200)]
Handle illegal \a tags like VSFilter

Treat the illegal \a value 8 like 5 for compatibility with VSFilter.

15 years agoopaque box: do not subtract glyph from border
Grigori Goronzy [Tue, 1 Sep 2009 00:39:51 +0000 (02:39 +0200)]
opaque box: do not subtract glyph from border

Similar to VSFilter, do not subtract the glyph bitmap from the border
bitmap when BorderStyle 3 is used.

15 years agoRevert "Merge glyph and outline bitmap better"
Grigori Goronzy [Tue, 1 Sep 2009 00:22:44 +0000 (02:22 +0200)]
Revert "Merge glyph and outline bitmap better"

This reverts commit d3cd5b0148d64ae0f6e288e69b09acfe639fdcce.
This hack improved blending in few situations, but at the same time
broke it in lots o others; get rid of it.

15 years agoCalculate glyph slant width correctly
Grigori Goronzy [Mon, 31 Aug 2009 00:52:03 +0000 (02:52 +0200)]
Calculate glyph slant width correctly

If a glyph is wider than its advance width for italic to non-italic
style changes, assume it was obliqued by FreeType's FT_GlyphSlot_Oblique
function and offset the next glyph accordingly.

15 years agoDo not close empty drawings
Grigori Goronzy [Sat, 29 Aug 2009 18:26:20 +0000 (20:26 +0200)]
Do not close empty drawings

If there are no points (i.e. illegal drawing), do not close the drawing
by incrementing the contour counter.  Under certain circumstances, this
can crash the FreeType stroker.

This fixes issue 7.

15 years agoFix order of pen advance assignments
Grigori Goronzy [Sun, 23 Aug 2009 14:41:36 +0000 (16:41 +0200)]
Fix order of pen advance assignments

15 years agoFix opaque box sizing again
Grigori Goronzy [Sun, 23 Aug 2009 14:33:38 +0000 (16:33 +0200)]
Fix opaque box sizing again

Another try to get it to work like in VSFilter.  Hopefully it's
behaving the same now (except in some cases, since VSFilter layouts
word-based, but libass is glyph-based).

Additionally, make sure horizontal letter spacing (\fsp) is scaled
according to ScaleX.

15 years agoFix glyph overlap blending
Grigori Goronzy [Sun, 23 Aug 2009 01:49:22 +0000 (03:49 +0200)]
Fix glyph overlap blending

Use the bitmap pointer for the cache hash key.  This preserves the
blending history, which fixes occasional corruptions due to previous
replacements not being dealt with correctly.  It also simplifies the
hash key a lot and thus speeds up cache lookups.

Additionally, change the blending equation from max(a, b) to min(a + b,
0xff), i.e. a saturating addition.  Usually this looks a lot better.

15 years agoUpdate changelog
Grigori Goronzy [Fri, 21 Aug 2009 23:15:09 +0000 (01:15 +0200)]
Update changelog

15 years agoScale kerning according to x font scaling factor
Grigori Goronzy [Fri, 21 Aug 2009 23:10:25 +0000 (01:10 +0200)]
Scale kerning according to x font scaling factor

15 years agoTrim whitespace after line wrapping
Grigori Goronzy [Fri, 21 Aug 2009 23:03:46 +0000 (01:03 +0200)]
Trim whitespace after line wrapping

Mark leading and trailing spaces on lines and adjust layouting code
to respect these marks and skip the spaces.

15 years agoClip vector blending: do not copy last row padding
Grigori Goronzy [Thu, 20 Aug 2009 14:41:11 +0000 (16:41 +0200)]
Clip vector blending: do not copy last row padding

Do not copy the padding on the last row into the new buffer since we
cannot rely on the padding actually existing; might fix a segfault in
some obscure cases.

15 years agoAdjust shearing behavior to match VSFilter
Grigori Goronzy [Thu, 20 Aug 2009 02:36:47 +0000 (04:36 +0200)]
Adjust shearing behavior to match VSFilter

Make horizontal shearing (\fax) shear from top to bottom of a glyph;
scale shearing factors with horizontal and vertical scaling factors.
This makes the shearing operations similar to VSFilter, except for
\fay in some cases, but this is not unexpected.  Vertical shearing
is implemented different on purpose.

15 years agoVSFilter quirk: double-scale widths of opaque boxes
Grigori Goronzy [Wed, 19 Aug 2009 21:10:24 +0000 (23:10 +0200)]
VSFilter quirk: double-scale widths of opaque boxes

VSFilter double-scales the widths of the opaque box in X direction,
which gives much wider boxes than expected (or much less wider boxes)
if ScaleX != 100.  Emulate this behavior, even if it is unbelievably
stupid and no doubt a bug in VSFilter.

15 years agoImprove and fix outline striker
Grigori Goronzy [Sat, 15 Aug 2009 01:31:52 +0000 (03:31 +0200)]
Improve and fix outline striker

Exit early if no striking is needed; make sure to strike in reverse
direction for non-truetype font and use the usual return value
convention (0 == no errors).

15 years agoFix caching of underlined/striked out glyphs
Grigori Goronzy [Sat, 15 Aug 2009 01:03:10 +0000 (03:03 +0200)]
Fix caching of underlined/striked out glyphs

15 years agoFix crash if glyph bitmap rasterization fails
Grigori Goronzy [Fri, 14 Aug 2009 11:57:02 +0000 (13:57 +0200)]
Fix crash if glyph bitmap rasterization fails

Check whether the glyph bitmap used for cache size calculations really
exists.

15 years agoUpdate changelog
Grigori Goronzy [Thu, 13 Aug 2009 23:43:56 +0000 (01:43 +0200)]
Update changelog

15 years agoImplement wrap style 1
Grigori Goronzy [Thu, 13 Aug 2009 23:34:31 +0000 (01:34 +0200)]
Implement wrap style 1

Skip application of the algorithm that moves words between the lines
to equalize line length for wrap style 1.

15 years agoCosmetics: ass_render.c formatting
Grigori Goronzy [Thu, 13 Aug 2009 22:10:51 +0000 (00:10 +0200)]
Cosmetics: ass_render.c formatting

15 years agoUse event bbox for collision detection
Grigori Goronzy [Wed, 12 Aug 2009 23:08:22 +0000 (01:08 +0200)]
Use event bbox for collision detection

Consider the bounding box of an event for collision detection instead
of only its vertical position and height.  This allows multiple events
per line if they don't overlap.

15 years agoScale ascender/descender for opaque boxes
Grigori Goronzy [Thu, 13 Aug 2009 15:25:56 +0000 (17:25 +0200)]
Scale ascender/descender for opaque boxes

15 years agoFix build without fontconfig
Alexis Ballier [Mon, 10 Aug 2009 10:03:13 +0000 (12:03 +0200)]
Fix build without fontconfig

15 years agoDo not draw opaque box if border size zero
Grigori Goronzy [Wed, 12 Aug 2009 04:42:48 +0000 (06:42 +0200)]
Do not draw opaque box if border size zero

This follows VSFilter's behavior.

15 years agoBorderStyle cache integration
Grigori Goronzy [Wed, 12 Aug 2009 04:36:43 +0000 (06:36 +0200)]
BorderStyle cache integration

Add new fields to the cache hash key for BorderStyle 3 (glyph cache
and bitmap cache).

15 years agoAlways parse colors as hex for ASS tracks
Grigori Goronzy [Wed, 12 Aug 2009 04:20:26 +0000 (06:20 +0200)]
Always parse colors as hex for ASS tracks

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.

15 years agoAdd glyph emboldening fallback
Grigori Goronzy [Wed, 12 Aug 2009 03:26:55 +0000 (05:26 +0200)]
Add glyph emboldening fallback

Fallback to embolden manually with FreeType in case a bold face was
requested, but no bold variant is available.  The glyphs are slightly
emboldened (much less than FT_GlyphSlot_Embolden would do) and the
metrics are not touched at all.

15 years agoFix italic to non-italic space handling
Grigori Goronzy [Wed, 12 Aug 2009 03:07:13 +0000 (05:07 +0200)]
Fix italic to non-italic space handling

Scan backwards in the glyph array for a glyph with some actual points
when correctin glyph spacing after italic to non-italic style changes.
This is mostly useful in case a space ends italicized text.

15 years agoSupport \q override tag
Grigori Goronzy [Wed, 12 Aug 2009 01:43:46 +0000 (03:43 +0200)]
Support \q override tag

Parse \q override tag and set a new state variable to its value.
The line wrapping code still needs improvements; wrap style 0/3 are not
entirely correctly implemented and style 1 is not implemented.

15 years agoImplement BorderStyle 3
Grigori Goronzy [Wed, 12 Aug 2009 00:59:00 +0000 (02:59 +0200)]
Implement BorderStyle 3

The "opaque box" border style renders an opaque box in the glyph area
instead of rendering a regular stroked border.  This implementation
replaces the glyph outline by an outline that contains only one
rectangle with the size of the glyph, plus optional extra border.

15 years agoFix advance for italic to non-italic style changes
Grigori Goronzy [Tue, 11 Aug 2009 23:45:39 +0000 (01:45 +0200)]
Fix advance for italic to non-italic style changes

After a italic to non-italic style change the space between the glyphs
is sometimes wrongly calculated, especially if the font doesn't have
an italic version and FreeType falls back to oblique glyphs.
In such cases, add additional space to the glyph's advance to make up
for the slant of the glyph; the amount is calculated from the glyph's
bbox.

15 years agoFactor out renderer types into separate file
Grigori Goronzy [Fri, 7 Aug 2009 08:56:38 +0000 (10:56 +0200)]
Factor out renderer types into separate file

15 years agoBump shared library version 0.9.7
Grigori Goronzy [Thu, 6 Aug 2009 23:26:42 +0000 (01:26 +0200)]
Bump shared library version

15 years agoBump LIBASS_VERSION due to renames
Grigori Goronzy [Thu, 6 Aug 2009 21:08:28 +0000 (23:08 +0200)]
Bump LIBASS_VERSION due to renames

15 years agoUse int for ScaledBorderAndShadow
Grigori Goronzy [Thu, 6 Aug 2009 11:17:21 +0000 (13:17 +0200)]
Use int for ScaledBorderAndShadow

Convert type for consistency with other booleans/flags that also use
int.

15 years agoRename typedefs (breaks API)
Grigori Goronzy [Thu, 6 Aug 2009 11:04:20 +0000 (13:04 +0200)]
Rename typedefs (breaks API)

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.

15 years agoCosmetics: add parameter name in prototype
Grigori Goronzy [Wed, 5 Aug 2009 01:36:58 +0000 (03:36 +0200)]
Cosmetics: add parameter name in prototype

15 years agoFix typo
Grigori Goronzy [Wed, 5 Aug 2009 01:21:01 +0000 (03:21 +0200)]
Fix typo

15 years agoClarify the AR parameter meanings
Grigori Goronzy [Wed, 5 Aug 2009 01:19:32 +0000 (03:19 +0200)]
Clarify the AR parameter meanings

Use the correct terms (SAR/DAR) for the aspect ratio parameters.

15 years agoGet rid of MAX_EVENTS limit
Grigori Goronzy [Wed, 29 Jul 2009 23:04:29 +0000 (01:04 +0200)]
Get rid of MAX_EVENTS limit

Allocate the maximum possible number of used events in fix_collisions
dynamically, eliminating the MAX_EVENTS limit.

15 years agoDo not round karaoke timing coordinates
Grigori Goronzy [Wed, 29 Jul 2009 19:33:29 +0000 (21:33 +0200)]
Do not round karaoke timing coordinates

Do not round the coordinates of the glyph bbox (when converting 26.6
fixed-point to integer); they are used for timing karaoke.  Doing so
can sometimes make \k and \ko karaoke not apply correctly.

15 years agoBring back names for public types
Grigori Goronzy [Tue, 28 Jul 2009 21:48:10 +0000 (23:48 +0200)]
Bring back names for public types

For the event/style/track types, bring back the struct name, but
without the _s suffix.  This is useful for forward declaration of
these types.

15 years agoFix \k and \ko tags
Grigori Goronzy [Tue, 28 Jul 2009 09:05:26 +0000 (11:05 +0200)]
Fix \k and \ko tags

The timing calculations for \k and \ko were off and still assumed
int values for a bbox, while it now uses a d6 representation.
This essentially made duration about 64 times as long as it should be.

15 years agoClean up typedefs/structs
Grigori Goronzy [Mon, 27 Jul 2009 23:42:03 +0000 (01:42 +0200)]
Clean up typedefs/structs

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.

15 years agoImprove message callback API
Grigori Goronzy [Sun, 26 Jul 2009 14:03:37 +0000 (16:03 +0200)]
Improve message callback API

Instead of passing a pointer to a va_list, pass the va_list itself.
Additionally, use const char for the format string and use names in
the prototype that describe the arguments' meaning.

15 years agoRemove shift vector in ass_render_event
Grigori Goronzy [Sat, 25 Jul 2009 01:59:58 +0000 (03:59 +0200)]
Remove shift vector in ass_render_event

The shift is not calculated when fetching a glyph anymore.  Instead,
it is calculated right before rasterizing a glyph.  Remove the
shift vector and make get_outline_glyph, the glyph cache and
ass_font_set_transform work without supplying a shift vector.

15 years agoAssume 4:3 AR when calculating missing PlayResX/Y
Grigori Goronzy [Sat, 25 Jul 2009 01:38:56 +0000 (03:38 +0200)]
Assume 4:3 AR when calculating missing PlayResX/Y

In case only one PlayResX/Y component is specified, calculate the other
component by assuming a 4:3 aspect ratio.  This is similar to vsfilter.

15 years agoHandle clip vector rasterizer errors
Grigori Goronzy [Fri, 24 Jul 2009 08:35:17 +0000 (10:35 +0200)]
Handle clip vector rasterizer errors

If rasterizing the clip vector fails, actually handle the situation
instead of crashing.

15 years agoDocument ass_hinting enum
Grigori Goronzy [Fri, 24 Jul 2009 08:17:56 +0000 (10:17 +0200)]
Document ass_hinting enum

Add a note to the docs regarding hinting method choice.

15 years agoFix renderer memory leaks
Grigori Goronzy [Fri, 24 Jul 2009 08:06:16 +0000 (10:06 +0200)]
Fix renderer memory leaks

Use the correct free order when freeing a ass_renderer and make sure
that the latest list of ass_images is freed, too.

Protect the font family string against double free and make sure it
is freed in free_render_context.

Leaks and access problems were found by valgrind/memcheck.

15 years agoFix fontconfig memory leaks
Grigori Goronzy [Fri, 24 Jul 2009 08:01:41 +0000 (10:01 +0200)]
Fix fontconfig memory leaks

Do not manually use FcConfigFilename; passing a NULL pointer to
FcConfigParseAndLoad is just as effective and also avoids a memory leak
since the string allocated by FcConfigFilename was never freed.

Free FcConfig instance in fontconfig_done; since we're not using the
default configuration anymore it doesn't make sense to keep the
configuration around.

Leaks were found by valgrind/memcheck.

15 years agoTest program: free track/renderer/library
Grigori Goronzy [Fri, 24 Jul 2009 07:59:47 +0000 (09:59 +0200)]
Test program: free track/renderer/library

In the test program, free the track, renderer and library properly.
This is useful for memory leak testing.

15 years agoFree tracks properly
Grigori Goronzy [Fri, 24 Jul 2009 07:58:01 +0000 (09:58 +0200)]
Free tracks properly

When freeing a track, also free the track name and the track itself.
Leak found by valgrind/memcheck.

15 years agoBuild system: enable/disable flags, pkg-config fixes
Grigori Goronzy [Fri, 24 Jul 2009 03:13:02 +0000 (05:13 +0200)]
Build system: enable/disable flags, pkg-config fixes

* Add enable/disable flags for enca, fontconfig and libpng.
* Add dependent libraries to pkg-config file to allow static linking.

15 years agoFix compilation without fontconfig
Grigori Goronzy [Fri, 24 Jul 2009 03:05:52 +0000 (05:05 +0200)]
Fix compilation without fontconfig

Adjust fontconfig_select and fontconfig_update stubs for the recent
changes.

15 years agoMove render_id into ass_renderer
Grigori Goronzy [Thu, 23 Jul 2009 01:23:28 +0000 (03:23 +0200)]
Move render_id into ass_renderer

The render_id (last_render_id) variable was the last remaining static
data object; move it into render_priv.

15 years agoFallback to default fontconfig configuration
Grigori Goronzy [Wed, 22 Jul 2009 20:49:55 +0000 (22:49 +0200)]
Fallback to default fontconfig configuration

If parsing or loading the fontconfig configuration file, either
using the default or a specified one, fails, try to load the
default fontconfig configuration.  This triggers loading a fallback
configuration if no configuration file is available at all.  A warning
message is emitted to notify the user about this.

15 years agoFix rasterizer error handling (double free)
Grigori Goronzy [Wed, 22 Jul 2009 01:24:42 +0000 (03:24 +0200)]
Fix rasterizer error handling (double free)

In case rasterizing a glyph is successful, but rasterizing its outline
is not, do not free the glyph bitmap.  It will be freed in cache cleanup
later.  Freeing it earlier leads to a double free.

15 years agoBold/italic: interpret -1 as "true"
Grigori Goronzy [Wed, 22 Jul 2009 01:21:33 +0000 (03:21 +0200)]
Bold/italic: interpret -1 as "true"

Interpret the value -1 as "true", as specified in the ASS
specifications.  Otherwise, clamp the value to 0 for other values <
0, so these are interpreted as "false".

15 years agoAdd check for libm to configure
Grigori Goronzy [Tue, 21 Jul 2009 12:23:30 +0000 (14:23 +0200)]
Add check for libm to configure

Check for libm and add the library to the linker flags.

15 years agoDo not double free default font/family buffers
Grigori Goronzy [Tue, 21 Jul 2009 12:03:46 +0000 (14:03 +0200)]
Do not double free default font/family buffers

Reported by Martin Sourada.

15 years agoFactor out bitmap buffer copy
Grigori Goronzy [Tue, 21 Jul 2009 01:06:05 +0000 (03:06 +0200)]
Factor out bitmap buffer copy

For clarity, factor out bitmap copying into a function. Do not pad the
bitmap with stride in the last row; this can not by guaranteed anyway.
Add a comment about this peculiarity to the API documentation in ass.h
Idea by Evgeniy Stepanov.

15 years agoClamp clip rectangle to frame size
Grigori Goronzy [Tue, 21 Jul 2009 00:39:52 +0000 (02:39 +0200)]
Clamp clip rectangle to frame size

Make sure the clip rectangle is inside the screen boundaries.
Idea by Evgeniy Stepanov.

15 years agoAnimations: allow equal start and end time
Grigori Goronzy [Mon, 20 Jul 2009 22:04:24 +0000 (00:04 +0200)]
Animations: allow equal start and end time

Do not set the end time of the animation to the end time of the event
in case end time and start time specified in a \t tag are equal.
This should sort out a problem introduced by commit 1f176b.