summaryrefslogtreecommitdiffstats
path: root/sub/subassconvert.c
Commit message (Collapse)AuthorAgeFilesLines
* subassconverter: silence clang warningStefano Pigozzi2013-04-281-1/+1
|
* subassconvert: do not escape likely ASS override tagswm42013-04-261-1/+19
| | | | | | | | | | | | | | | | | | | | | | | Usually SubRip files are not expected to contain ASS override tags, but unfortunately these files seem to become more common. Example from a real file: 1 00:00:00,800 --> 00:00:15,000 {\an8}本字幕由 {\c&H26F4FF&}ShinY {\c&HFFAE1A&}深影字幕组{\c&HFFFFFF&} 原创翻译制作 subassconvert.c escaped '{', so that libass displayed the above line literally. Try to apply a simple heuristic to detect whether '{' is likely to start an ASS tag: if the string starts with '{\', and there is a closing '}', assume it's an ASS tag, otherwise escape the '{' properly. If it's a likely ASS tag, it's passed through to libass. The end result is that the above script is displayed in color, while at the same time legitimate uses of '{' and '}' should work fine. We assume that nobody uses {...} for commenting text in SubRip files. (This kind of comment is popular and legal in ASS files, though.)
* subassconvert: add more web colorswm42013-04-201-24/+153
| | | | | | | | Now includes the complete list from [1] at this time. Switch from BGR to RGB to match with that list. [1] http://www.w3.org/TR/css3-color/#svg-color
* Fix missing ctype.h includeswm42013-03-041-0/+1
| | | | | libavutil/common.h stopped including ctype.h, and some source files were relying on recursive inclusion of this header.
* subassconverter: correctly handle RRGGBB and unknow formatsStefano Pigozzi2012-11-251-22/+31
| | | | | | | The following HEX formats are now parsed correctly: `#RRGGBB`, `RRGGBB`. Moreover this implementation doesn't show the HTML on screen if the input color is not recognized. A warning is still displayed in the terminal.
* Rename directories, move files (step 2 of 2)wm42012-11-121-2/+2
| | | | | | | | | | | | Finish renaming directories and moving files. Adjust all include statements to make the previous commit compile. The two commits are separate, because git is bad at tracking renames and content changes at the same time. Also take this as an opportunity to remove the separation between "common" and "mplayer" sources in the Makefile. ("common" used to be shared between mplayer and mencoder.)
* subassconvert: order colour names alphabetically / better match W3 listmplayer-svn2012-08-031-7/+23
| | | | | | | | | | | | | | | | Order colour names alphabetically / better match W3 list. Patch by Federico Kereki, fkereki gmail git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35006 b3059339-0415-0410-9bf9-f77b7e298cf2 Add a few new CSS colors. Patch by Federico Kereki, fkereki gmail git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35007 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: cehoyos
* bstr: rename bstr() function to bstr0(), and typedef bstr to struct bstrwm42012-07-281-2/+2
| | | | | Replace all uses of bstr() with bstr0(). Also remove the ridiculous C++ workaround.
* subassconvert: make subrip attribute parsing more robustUoti Urpala2012-04-171-33/+34
| | | | | | | Add general code to separate the HTML-like attribute=value syntax used in srt font tags into attribute and value parts. This simplifies some of the parsing code, makes detection of malformed input more robust, and allows warning about unrecognized attributes.
* subassconvert: handle unquoted attributes in subrip font tagswm42012-04-171-27/+45
| | | | | Previously, mplayer didn't convert tags like <font color=#00FF00>. But such subtitles exist in the wild, and should be handled.
* subassconvert: handle "\r\n" line endsClément Bœsch2011-09-021-1/+1
| | | | | | | | | Previously the code converting text subtitles to ASS format converted newline characters, and only those, to ASS "new line" markup. If the subtitles contained "\r\n", the "\r" was thus left in the text. In previous libass versions the "\r" was not visible, but in the current one it produces an empty box. Improve the conversion to remove the "\r" in that case. Also treat a lone "\r" as a newline.
* subtitles: style support for common SubRip tags and MicroDVDUoti Urpala2011-01-181-0/+502
SubRip subtitles have no "official" spec for any styling support, but various tags are in common use; previous code filtered out text between <> to remove HTML-style tags. Add support for those tags and for MicroDVD subtitle styling. The style display is implemented by converting the subtitles to the ASS subtitle format and displaying them with libass, so libass needs to be enabled. Original patch by Clément Bœsch <ubitux@gmail.com>.