summaryrefslogtreecommitdiffstats
path: root/libass/ass.c
Commit message (Collapse)AuthorAgeFilesLines
* refactor: move track init into ass track parserGrigori Goronzy2011-06-061-0/+33
|
* Nicer default styleGrigori Goronzy2011-05-301-1/+1
| | | | Use 50% alpha for the shadow. Looks nicer and is just like VSFilter.
* Remove misleading comment about style case sensitivityGrigori Goronzy2011-04-091-1/+0
| | | | VSFilter always matches style names case sensitive.
* Much improved "Default" styleGrigori Goronzy2011-04-091-2/+36
| | | | | | 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.
* Relicense to ISCGrigori Goronzy2010-09-281-12/+10
| | | | | | 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.
* Get rid of NULL checks for freeGrigori Goronzy2010-08-091-22/+14
| | | | | The useless "if (foo) free(foo)" idiom is all over the place, just get rid of it finally...
* Fix another minor leak (event_format overwriting)Grigori Goronzy2010-08-091-0/+1
|
* Fix leaking of script-embedded fontsGrigori Goronzy2010-08-091-4/+2
|
* POSIX compliance: add strings.h include where appropriateGrigori Goronzy2010-08-071-0/+1
| | | | | strcasecmp/strncasecmp needs strings.h according to POSIX, so add this include where these occur.
* Limit debug output on parsing errorsGrigori Goronzy2010-07-191-1/+1
| | | | Limit context printed after parsing errors to 30 characters
* Add API function to flush all eventsGrigori Goronzy2010-05-311-0/+14
| | | | | | 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).
* Basic @font supportGrigori Goronzy2010-04-111-6/+0
| | | | | | 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.
* Remove file size limit in ass_read_fileGrigori Goronzy2010-02-061-9/+0
| | | | | | 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.
* Up size limit for script filesGrigori Goronzy2010-01-191-2/+3
| | | | | | 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.
* Fix leftovers from conversion to ass_strtodYuriy M. Kaminskiy2010-01-121-3/+5
|
* Don't flag for freeing if codepage is unspecifiedGrigori Goronzy2010-01-061-5/+6
| | | | Patch by Arne Morten Kvarving <spiff@micron.(none)>.
* Disable kerning by default and make it configurableGrigori Goronzy2009-09-081-0/+4
| | | | | | | | | | | | | | | | | | 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.
* Always parse colors as hex for ASS tracksGrigori Goronzy2009-08-121-1/+1
| | | | | | 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 typedefs (breaks API)Grigori Goronzy2009-08-061-62/+66
| | | | | | 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.
* Clean up typedefs/structsGrigori Goronzy2009-07-281-1/+1
| | | | | 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.
* Free tracks properlyGrigori Goronzy2009-07-241-0/+2
| | | | | When freeing a track, also free the track name and the track itself. Leak found by valgrind/memcheck.
* Message callback funtionalityGrigori Goronzy2009-07-111-53/+66
| | | | | | | | | | | 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]".
* Replace string defines with real stringsGrigori Goronzy2009-07-111-38/+37
| | | | | | 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.
* Fix crash when event format spec is missingGrigori Goronzy2009-07-071-13/+22
| | | | | | | | 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.
* Remove read_file_recode from APIGrigori Goronzy2009-07-011-1/+1
| | | | | | 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.
* API: make process_force_style availableGrigori Goronzy2009-06-291-3/+3
| | | | | Rename process_force_style to ass_process_force_style and make it available in the DSO.
* Include ass_utils.h instead of mputils.hGrigori Goronzy2009-06-271-1/+0
|
* Rename various non-static functionsGrigori Goronzy2009-06-271-1/+1
| | | | | Rename a few functions to avoid symbol clashes. Clean up mputils.h.
* Rename mp_msg to ass_msgGrigori Goronzy2009-06-271-29/+29
|
* Remove static variable modifier in sub_recodegreg2009-06-201-1/+1
| | | | A variable was needlessly static, this has been corrected.
* Reindent all source code.greg2009-06-201-834/+914
| | | | | | | | | | | | | | | 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
* whitespace cosmetics: Remove all trailing whitespace.diego2009-05-131-44/+44
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* Use ScaledBorderAndShadow: yes by default.greg2009-03-111-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28935 b3059339-0415-0410-9bf9-f77b7e298cf2
* Style override for ScaledBorderAndShadow.greg2009-03-051-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28821 b3059339-0415-0410-9bf9-f77b7e298cf2
* Support ScaledBorderAndShadow property.greg2009-03-051-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28820 b3059339-0415-0410-9bf9-f77b7e298cf2
* libass: fix type mismatch between size parameter and the way it's usedaurel2008-09-051-1/+1
| | | | 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-051-4/+16
| | | | | | | conforming to the ASS spec git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27530 b3059339-0415-0410-9bf9-f77b7e298cf2
* Rename font-related preprocessor directives.diego2008-08-071-6/+6
| | | | | | | 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-011-5/+5
| | | | | | | 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-301-5/+5
| | | | | | | | 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
* 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
* 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
* Speak of libass instead of MPlayer in the libass license headers.diego2008-05-141-4/+4
| | | | | | | | 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
* Use standard license header.diego2008-05-131-16/+18
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26755 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
* 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
* Allow overriding [Script Info] parameters with -ass-force-style option.eugeni2008-01-051-0/+9
| | | | | | | Patch by Anton Khirnov, wyskas gmail com. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25610 b3059339-0415-0410-9bf9-f77b7e298cf2
* typodiego2007-12-301-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25543 b3059339-0415-0410-9bf9-f77b7e298cf2
* Our enca code uses strdup() on the input encoding name, as we don't modify ↵iive2007-10-281-4/+1
| | | | | | | | | | it we can use the original constant string. Uses less memory, code is simpler and faster. Fixes memory leak (noticed by ulion). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24879 b3059339-0415-0410-9bf9-f77b7e298cf2
* When parsing ass-force-style arguments, search for '=' and '.' characters witheugeni2007-06-151-2/+2
| | | | | | | | strrchr. This allows using it for styles whose name contains those characters. Patch by Бранко Мајић <branko majic at gmail com>. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23560 b3059339-0415-0410-9bf9-f77b7e298cf2
* Make sure there is at least one style in ass_track when parsing events.eugeni2007-06-151-7/+8
| | | | | | | Before it was only checked for embedded subtitles. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23559 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move code for reading a file and recoding it to utf-8 to a separate function.eugeni2007-06-011-9/+21
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23442 b3059339-0415-0410-9bf9-f77b7e298cf2
* Support fractional font sizes.eugeni2007-05-141-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23318 b3059339-0415-0410-9bf9-f77b7e298cf2
* Don't deallocate font data if it will be used later.eugeni2007-05-091-1/+3
| | | | | | | | It produced either segfault or "Error opening memory font" with any script that contains embedded fonts. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23282 b3059339-0415-0410-9bf9-f77b7e298cf2
* Both (-1) and 1 mean bold font in SSA/ASS styles.eugeni2007-02-191-0/+3
| | | | | | | The same for italics and some other fields. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22281 b3059339-0415-0410-9bf9-f77b7e298cf2
* Correct implementation of text spacing.eugeni2007-02-191-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22277 b3059339-0415-0410-9bf9-f77b7e298cf2
* Keep embedded fonts in ass_library_t and perform actual disk writeeugeni2006-12-031-80/+0
| | | | | | | | in fontconfig initialization. This is required for some fontconfig-related improvements. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21474 b3059339-0415-0410-9bf9-f77b7e298cf2
* Rename: ass_process_font -> ass_add_font.eugeni2006-12-031-3/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21471 b3059339-0415-0410-9bf9-f77b7e298cf2
* Avoid calling validate_fname() twice for one string.eugeni2006-12-031-3/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21469 b3059339-0415-0410-9bf9-f77b7e298cf2
* MSGTRs for libasskraymer2006-11-191-15/+15
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21082 b3059339-0415-0410-9bf9-f77b7e298cf2
* Collect all includes of mplayer headers in libass in a single file (mputils.h).eugeni2006-11-191-6/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21042 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix the following compiler warnings:eugeni2006-11-051-2/+1
| | | | | | | | | ass.c:999: warning: unused variable 'i' ass.c:1041: warning: pointer targets in assignment differ in signedness ass.c:1043: warning: pointer targets in assignment differ in signedness git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20714 b3059339-0415-0410-9bf9-f77b7e298cf2
* Introduce MSGT_ASS, use it for all libass messages.eugeni2006-11-031-30/+30
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20645 b3059339-0415-0410-9bf9-f77b7e298cf2
* Implement loading subtitles from memory.eugeni2006-11-031-24/+93
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20619 b3059339-0415-0410-9bf9-f77b7e298cf2
* Bugfix: sub_recode could deallocate global sub_cp under some circumstances.eugeni2006-11-031-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20618 b3059339-0415-0410-9bf9-f77b7e298cf2
* Revert r20517.eugeni2006-10-291-2/+7
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20519 b3059339-0415-0410-9bf9-f77b7e298cf2
* Copy the following functions to libass to avoid dependency on the rest of ↵eugeni2006-10-291-7/+2
| | | | | | | | | | | | mplayer: guess_buffer_cp utf8_get_char blur git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20517 b3059339-0415-0410-9bf9-f77b7e298cf2
* Libass interface reworked:eugeni2006-10-281-27/+26
| | | | | | | | | - ass_instance_t renamed to ass_renderer_t - ass_library_t introduced - use of mplayer-specific global variables limited to ass_mp.c git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20493 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add copyright notice and vim/emacs comments to libass and vf_ass.c.eugeni2006-10-011-0/+20
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20014 b3059339-0415-0410-9bf9-f77b7e298cf2
* Set ReadOrder values for external subtitles.eugeni2006-09-191-0/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19911 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add -ass-styles option. It allows to load styles from a file and use themeugeni2006-09-031-10/+43
| | | | | | | for plain text subtitles rendering. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19658 b3059339-0415-0410-9bf9-f77b7e298cf2
* Don't sort events when reading external subs. With r19644, the order does ↵eugeni2006-09-021-19/+0
| | | | | | not matter. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19645 b3059339-0415-0410-9bf9-f77b7e298cf2
* Better collision detection algorithm. The idea is to keep a subtitle in placeeugeni2006-09-021-0/+2
| | | | | | | | when a lower placed one disappears, thus improving readability. As a side effect, layers are supported now. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19644 b3059339-0415-0410-9bf9-f77b7e298cf2
* Read layer info from external subs.