summaryrefslogtreecommitdiffstats
path: root/libass
Commit message (Collapse)AuthorAgeFilesLines
* libass: If a bad subtitle has multiple \pos use firstUoti Urpala2008-12-221-4/+9
| | | | | | | | Having multiple \pos makes no sense, but such files exist. Apparently VSFilter uses the values from the first \pos in this case whereas libass used the last one. Change the behavior to make it compatible with VSfilter since this has the highest chance of matching what the creators of the file intended.
* libass: Fix cache lookup problem causing memory bloatUoti Urpala2008-12-223-31/+100
| | | | | | | | | | | | | | | | | | | | | | The cache code did hash lookups by storing key values in struct fields and then hashing and comparing the struct as a single memory block. In at least one case such a struct contained uninitialized padding bytes which prevented the complete memory area of the struct from matching even though the fields did. As a result the code failed to find existing objects in the cache and stored new versions of them, causing gigabytes of memory use in some circumstances. Initializing the struct memory to zero before writing the fields avoided such memory use in tests but is not guaranteed to work if I interpret the C standard correctly (the compiler is allowed to write garbage over padding bytes when changing struct member values). Change the code to use struct-specific hashing and comparison functions that work field by field to guarantee correct behavior. Create these by replacing the struct definition with a template that lists the fields and can be used the generate each of struct definition, hash function and compare function with some preprocessor magic (otherwise every field would need to be listed separately in all three).
* Merge svn changes up to r28087Uoti Urpala2008-12-041-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: command.c libao2/ao_ivtv.c libao2/ao_v4l2.c libmpcodecs/dec_video.h libvo/aspect.h libvo/sub.c libvo/sub.h libvo/vo_directx.c libvo/vo_macosx.m libvo/vo_quartz.c mp_core.h mplayer.c mplayer.h osdep/getch2.h osdep/timer.h
| * Get rid of pointless 'extern' keywords.diego2008-12-031-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28085 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r27899Uoti Urpala2008-11-061-11/+9
|\|
| * Consistently use NULL for pointers instead of 0.reimar2008-11-021-6/+6
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27876 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Fallback to non-fontconfig behaviour when fontconfig initialization fails.reimar2008-11-021-5/+3
| | | | | | | | | | | | | | Also fixes a memleak in that case, bug #1313. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27875 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r27573Uoti Urpala2008-09-102-6/+26
|\| | | | | | | | | Conflicts: libmpcodecs/vd_ffmpeg.c
| * libass: fix type mismatch between size parameter and the way it's usedaurel2008-09-052-2/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27531 b3059339-0415-0410-9bf9-f77b7e298cf2
| * libass: add a new ass_process_data() to process demuxed subtitle packetsaurel2008-09-052-4/+24
| | | | | | | | | | | | | | conforming to the ASS spec git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27530 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r27458Uoti Urpala2008-08-121-1/+12
|\|
| * Don't print drawing commands on screen.eugeni2008-08-081-1/+12
| | | | | | | | | | | | | | Drawing mode is not implemented in libass. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27442 b3059339-0415-0410-9bf9-f77b7e298cf2
| * If (has outline) blur(outline) else blur(glyph).eugeni2008-08-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | If there is an outline, the glyph itself should not be blurred. Keeps the border between glyph and outline clear (unblurred), which is probably how it should be. Patch by Diogo Franco (diogomfranco gmail com). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27441 b3059339-0415-0410-9bf9-f77b7e298cf2
| * \org turns off collision detection.eugeni2008-08-071-0/+1
| | | | | | | | | | | | | | Patch by Diogo Franco (diogomfranco gmail com). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27440 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Treat \h as space character.eugeni2008-08-071-1/+1
| | | | | | | | | | | | | | Patch by Robert Rudd (robrudd at users sourceforge net). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27439 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Calculate subtitle origin in floating point.eugeni2008-08-071-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27438 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Calculate subtitle position in floating point.eugeni2008-08-071-7/+7
| | | | | | | | | | | | | | | | Improves subtitle position precision from a unit of script coordinates to a screen pixel. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27437 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Make various functions staticUoti Urpala2008-08-121-3/+3
| |
* | Merge svn changes up to r27441Uoti Urpala2008-08-087-25/+27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: cfg-common-opts.h command.c configure input/input.c libmpcodecs/dec_video.c libmpcodecs/vd.c libmpdemux/stheader.h libvo/sub.c libvo/video_out.c libvo/vo_xv.c libvo/vosub_vidix.c libvo/x11_common.c libvo/x11_common.h mp_core.h mplayer.c stream/stream.h
| * Rename font-related preprocessor directives.diego2008-08-075-15/+15
|/ | | | | | | Switch them from a HAVE_ to a CONFIG_ prefix. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27425 b3059339-0415-0410-9bf9-f77b7e298cf2
* Rename some preprocessor directives from CONFIG_* to HAVE_* where appropriate;diego2008-08-012-6/+6
| | | | | | | 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
* Start unifying names of internal preprocessor directives.diego2008-07-302-6/+6
| | | | | | | | 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
* Fix \fn without an argument consuming the next '\'.eugeni2008-07-091-6/+7
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27242 b3059339-0415-0410-9bf9-f77b7e298cf2
* Check if the font set returned from FcFontSort in not NULL.eugeni2008-06-231-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27128 b3059339-0415-0410-9bf9-f77b7e298cf2
* Reindent.eugeni2008-06-231-35/+36
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27127 b3059339-0415-0410-9bf9-f77b7e298cf2
* Only use application font dir if library->fonts_dir is not NULL.eugeni2008-06-231-0/+2
| | | | | | | | This can be the case if ass_set_fonts_dir() call is omitted, results in segfault. Never happens in the current MPlayer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27126 b3059339-0415-0410-9bf9-f77b7e298cf2
* The size of output buffer is stored in 'osize', not 'size'.eugeni2008-05-291-1/+1
| | | | | | | 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
* Clear iconv conversion state also in libass.eugeni2008-05-291-3/+11
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26923 b3059339-0415-0410-9bf9-f77b7e298cf2
* Offset should be size_t.eugeni2008-05-291-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26922 b3059339-0415-0410-9bf9-f77b7e298cf2
* Cosmetics: reindent after the last commit.eugeni2008-05-221-25/+25
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26857 b3059339-0415-0410-9bf9-f77b7e298cf2
* Read all faces of a memory font, not just the first one.eugeni2008-05-221-1/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26856 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix compilation with FontConfig <= 2.2.96.eugeni2008-05-221-0/+2
| | | | | | | | It lacks FcPatternRemove function. The code will work fine, but produce an incorrect "Selected font is not the requested one" warning in rare cases. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26851 b3059339-0415-0410-9bf9-f77b7e298cf2
* In case 2 styles have the same name, prefer the latest one.eugeni2008-05-191-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26839 b3059339-0415-0410-9bf9-f77b7e298cf2
* cosmetics: Remove useless parentheses from return statements.diego2008-05-161-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26791 b3059339-0415-0410-9bf9-f77b7e298cf2
* Speak of libass instead of MPlayer in the libass license headers.diego2008-05-1419-76/+76
| | | | | | | | We already use LIBASS_ prefixes for the multiple inclusion guards. Thus libass can be considered separate enough to warrant this. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26770 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add standard license header.diego2008-05-131-0/+20
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26757 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix one more license header wording detail for consistency.diego2008-05-131-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26756 b3059339-0415-0410-9bf9-f77b7e298cf2
* Use standard license header.diego2008-05-1318-288/+324
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26755 b3059339-0415-0410-9bf9-f77b7e298cf2
* When building font pattern, treat both ' ' and '-' as word separators.eugeni2008-05-111-7/+9
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26742 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix possible free of unallocated memory.eugeni2008-05-111-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26741 b3059339-0415-0410-9bf9-f77b7e298cf2
* Define FC_FULLNAME and FC_EMBOLDEN to fix compilation with ancient fontconfig.eugeni2008-05-081-0/+10
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26692 b3059339-0415-0410-9bf9-f77b7e298cf2
* If both full name and family are available, use the former in inexact match ↵eugeni2008-05-081-1/+1
| | | | | | warning. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26691 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove extra family names from the search pattern after FcFontSort andeugeni2008-05-081-6/+18
| | | | | | | | | | | call FcFontRenderPrepare to select the best family name for the font in case there are several of them. This does not affect font matching results, but helps to avoid warning about inexact match. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26690 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix the second fontconfig_init function as the declaration in the .h file.ulion2008-05-031-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26652 b3059339-0415-0410-9bf9-f77b7e298cf2
* Print more info about selected font.eugeni2008-05-021-2/+24
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26648 b3059339-0415-0410-9bf9-f77b7e298cf2
* Rewrite font family check in a simpler way.eugeni2008-05-021-8/+9
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26647 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move font family check to the end of the list.eugeni2008-05-021-5/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26646 b3059339-0415-0410-9bf9-f77b7e298cf2
* Cosmetics: rename local variables to better reflect their contents.eugeni2008-05-021-17/+17
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26645 b3059339-0415-0410-9bf9-f77b7e298cf2
* Skip '@' at the beginning of the font name.eugeni2008-05-011-0/+6
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26625 b3059339-0415-0410-9bf9-f77b7e298cf2
* Only warn if both font family and it's full name are different from requested.eugeni2008-05-011-3/+6
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26624 b3059339-0415-0410-9bf9-f77b7e298cf2
* Allow inexact font family matching.eugeni2008-05-011-0/+20
| | | | | | | | | | | | | | | In SSA/ASS fonts are sometimes referenced by their "full name", which is usually a concatenation of family name and font style (ex. Ottawa Bold). Full name is available from FontConfig pattern element FC_FULLNAME, but it is never used for font matching. Therefore, I'm removing words from the end of the name one by one, and adding shortened names to the pattern. It seems that the first value (full name in this case) has precedence in matching. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26623 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove libass dependency on global font_fontconfig variable.eugeni2008-04-305-9/+26
| | | | | | | | | A new function (ass_set_fonts_nofc) is introduced instead of an extra argument to existing ass_set_fonts to keep binary compatibility with older versions of the library. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26614 b3059339-0415-0410-9bf9-f77b7e298cf2
* Merge libass/Makefile into Makefile, one less recursive make directory.diego2008-04-081-15/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26356 b3059339-0415-0410-9bf9-f77b7e298cf2
* Case insensitive parsing of SSA/ASS section headers.eugeni2008-03-301-5/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26303 b3059339-0415-0410-9bf9-f77b7e298cf2
* Skip BOM at the beginning of text in ASS parser.eugeni2008-03-301-2/+6
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26302 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add missing header #includes to fix 'make checkheaders'.diego2008-03-058-0/+25
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26170 b3059339-0415-0410-9bf9-f77b7e298cf2
* Comment out dump_glyph(): it is unused and, as it is now, breaks compilation.eugeni2008-02-222-1/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26068 b3059339-0415-0410-9bf9-f77b7e298cf2
* Check glyph bounding box before rasterizing and complain if it is too large.eugeni2008-02-221-0/+16
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26067 b3059339-0415-0410-9bf9-f77b7e298cf2
* Some debugging routines.eugeni2008-02-222-0/+27
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26066 b3059339-0415-0410-9bf9-f77b7e298cf2
* Better handling of behind-the-camera objects.eugeni2008-02-221-2/+3
| | | | | | | | | Every point that is behind the camera is moved to the clipping plane by orthographic projection. It is obviously incorrect, but this is a very rare case, and proper clipping of Bezier curves is not that easy. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26065 b3059339-0415-0410-9bf9-f77b7e298cf2
* Print FreeType version in libass init. Makes error logs slightly more helpful.eugeni2008-02-221-0/+7
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26064 b3059339-0415-0410-9bf9-f77b7e298cf2
* Consistently give all libass multiple inclusion guards a LIBASS_ prefix.diego2008-01-2910-30/+30
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25927 b3059339-0415-0410-9bf9-f77b7e298cf2
* Consistently use uppercase filename as multiple inclusion guard.diego2008-01-281-3/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25897 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add global ass_force_reload flag.eugeni2008-01-232-0/+15
| | | | | | | If it is set, renderer is reconfigured before the next frame. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25841 b3059339-0415-0410-9bf9-f77b7e298cf2
* Do not try to guess font metrics based on its bounding box.eugeni2008-01-121-8/+2
| | | | | | | | | It was originally a workaround for fonts with bad ascender/descender values, but it breaks display of some otherwise valid fonts (bugzilla 987), so reverted. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25688 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix ass_clear_fonts not deallocating fontdata.eugeni2008-01-081-0/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25649 b3059339-0415-0410-9bf9-f77b7e298cf2
* No need to reinvent strdup...eugeni2008-01-071-2/+1