wm4 [Fri, 14 Nov 2014 00:45:09 +0000 (01:45 +0100)]
Fix the bug
Commit 8536eaa was slightly broken: for some incomprehensible reason,
(w + 1) memory instead of w is needed. The missing space could lead to
memory corruption and crashes.
wm4 [Thu, 16 Oct 2014 23:26:30 +0000 (01:26 +0200)]
Silence compilation warning
This fixes the following warnings:
In file included from ass_cache.c:34:0:
ass_cache_template.h:52:0: warning: "BINSTRING" redefined
#define BINSTRING(member) \
^
In file included from ass_cache.h:59:0,
from ass_font.h:58,
from ass_cache.c:28:
ass_cache_template.h:9:0: note: this is the location of the previous definition
#define BINSTRING(member) \
^
In file included from ass_cache.c:36:0:
ass_cache_template.h:30:0: warning: "BINSTRING" redefined
#define BINSTRING(member) \
^
In file included from ass_cache.c:34:0:
ass_cache_template.h:52:0: note: this is the location of the previous definition
#define BINSTRING(member) \
^
Oleg Oshmyan [Thu, 29 May 2014 23:01:41 +0000 (00:01 +0100)]
Use ass_drawing_add_chars for vector drawings
This not only provides a performance improvement but also
conveniently fixes the following issue: we used to interpret
backslash-escapes in vector drawings, but we shouldn't.
They can be used to force dialog text to use a specific ASS_Style. It
uses a fuzzy heuristic for that, and the quality of results may vary.
It does style overriding selectively and tries not to override things
that need explicit styling. The heuristic for that isn't set in stone
either, and can change with future libass versions.
wm4 [Sat, 31 May 2014 21:19:45 +0000 (23:19 +0200)]
Fix change detection when text is clipped to screen
The glyphs are clipped before combining, so the combined bitmap can
always have the same position, size, and address. This breaks the
change detection. Or at least I think that's what happens.
Grigori Goronzy [Thu, 29 May 2014 01:59:08 +0000 (03:59 +0200)]
shaper: add FriBidi error handling
It is unlikely, but FriBidi might not process a string correctly,
and we should handle that. Tested by making it fail always. This
should also fix some compiler warnings.
Oleg Oshmyan [Thu, 1 May 2014 01:38:33 +0000 (02:38 +0100)]
Reset clipping mode on every rectangle \clip
Prior to this fix, both of the following:
\iclip(0,0,9999,9999)\clip(0,0,9999,9999)
\iclip(0,0,0,0)\clip(0,0,9999,9999)
hid the whole picture in libass. The correct behavior
in both cases is to display the whole picture.
Oleg Oshmyan [Thu, 13 Mar 2014 01:07:47 +0000 (01:07 +0000)]
Remove dirty pixels from ASM be_blur output
A loop initializer was missing, so output started one row too early.
A loop condition check was missing, so output sometimes stopped
one column too late.
Oleg Oshmyan [Wed, 12 Mar 2014 22:06:28 +0000 (22:06 +0000)]
Fix handling of top two pixel rows in be_blur_c
5dd56af2 replaced our implementation of \be with xy-VSFilter's.
This error is not present in the xy-VSFilter code; it was introduced
by accident in a merge that was later squashed as part of 5dd56af2.
Note: the new \be reads in but does not write out
the first and last row and column of pixels.
wm4 [Thu, 6 Mar 2014 21:23:01 +0000 (22:23 +0100)]
Fix change detection in presence of vector clips
Fixes this test case:
Dialogue: 0,0:00:00.00,0:00:02.00,,,0,0,0,,{\fs50\pos(250,250)\iclip(m 0 0 l 400 0 l 400 220 l0 220)}Hello
Dialogue: 0,0:00:02.00,0:10:00.00,,,0,0,0,,{\fs50\pos(250,250)\iclip(m 0 0 l 400 0 l 400 230 l0 230)}Hello
The problem here is that the rendered output bitmap list itself does
not change, only its contents (due to the different vector clip).
ass_render_frame() will not set *detect_change correctly, and an
application using this flag (like mplayer or mpv) will not update
the screen as needed.
Fix this with a very cheap hack: always report a full change if
there's a vector clip. This is basically an emergency fix until
we have a proper way to detect the change.
wm4 [Mon, 3 Mar 2014 14:52:54 +0000 (15:52 +0100)]
Don't crash on \fscx0
Freetype can return a bounding box with all fields set to INT_MIN if an
outline with all points set to 0 is used. This can happen e.g. with
\fscx0, but also in more complicated cases. (In the original crashing
sample, this was probably caused in combination with an embedded font.)
Such a bounding box causes libass to crash, because it will enlarge the
combined bitmap bounding box to a ridiculous size.
Just skip outlines that have en empty bounding box. This is probably
the correct thing to do, and won't pass INT_MAX down to other parts
of libass.
Grigori Goronzy [Wed, 29 Jan 2014 04:23:55 +0000 (05:23 +0100)]
shaper: use global features correctly
start/end of feature tags is unsigned, so use the proper constant
to signal to HarfBuzz that these features are global. This allows
HarfBuzz to cache shape plans, and that can considerably speed up
shaping, especially if many small runs need to be shaped.