summaryrefslogtreecommitdiffstats
path: root/sub/ass_mp.c
Commit message (Collapse)AuthorAgeFilesLines
* sub: simplify code by always defining sub_cpwm42012-08-031-4/+0
|
* ass_mp.c: remap libass log levelswm42012-07-301-0/+12
| | | | | | | | | | libass is way too chatty. The application using it shouldn't be forced to print useless messages, especially not if the action was initiated by the application, and libass successfully completes it. Note that this might be a problem that should be fixed in libass, but remapping the log levels is needed anyway (instead of relying on the coincidence that the log level values are similar).
* osd: remove freetype font rendering codewm42012-07-281-17/+9
| | | | | | | | | | | | The previous commit made libass the default OSD renderer. This commit removes the disabled freetype renderer completely. The commits were done separately to make rolling back easier, because using libass for OSD rendering is a risky choice. Also remove freetype/fontconfig/fribidi code. This is all done by libass now. If mplayer is compiled without libass, no OSD is displayed.
* osd: use libass for OSD renderingwm42012-07-281-13/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OSD will now be rendered with libass. The old rendering code, which used freetype/fontconfig and did text layout manually, is disabled. To re-enable the old code, use the --disable-libass-osd configure switch. Some switches do nothing with the new code enabled, such as -subalign, -sub-bg-alpha, -sub-bg-color, and many more. (The reason is mostly that the code for rendering unstyled subtitles with libass doesn't make any attempts to support them. Some of them could be supported in theory.) Teletext rendering is not implemented in the new OSD rendering code. I don't have any teletext sources for testing, and since teletext is being phased out world-wide, the need for this is questionable. Note that rendering is extremely inefficient, mostly because the libass output is blended with the extremely strange mplayer OSD format. This could be improved at a later point. Remove most OSD rendering from vo_aa.c, because that was extremely hacky, can't be made work with osd_libass, and didn't work anyway in my tests. Internally, some cleanup is done. Subtitle and OSD related variable declarations were literally all over the place. Move them to sub.h and sub.c, which were hoarding most of these declarations already. Make the player core in mplayer.c free of concerns like bitmap font loading. The old OSD rendering code has been moved to osd_ft.c. The font_load.c and font_load_ft.c are only needed and compiled if the old OSD rendering code is configured.
* Merge remote-tracking branch 'origin/master'wm42012-04-281-1/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: command.c libao2/ao_alsa.c libao2/ao_dsound.c libao2/ao_pulse.c libao2/audio_out.h mixer.c mixer.h mplayer.c Replace my mixer changes with uau's implementation, which is based on my code.
| * subs: only use "subfont.ttf" as libass fallback if it existsUoti Urpala2012-04-141-1/+6
| | | | | | | | | | | | | | | | | | | | Libass was set to use the file "subfont.ttf" in the user configuration directory as a default/fallback font. This triggered "Error opening font" errors from libass if it tried to use the fallback font for some glyph and the user had not copied/linked any font there (and there is generally little reason to do that nowadays when using fontconfig). Check whether the path exists and only set it in ass_set_fonts() if it does.
* | ass_mp.c: remove code duplicationwm42012-03-061-2/+1
|/ | | | | | | mp_ass_configure() (first time setup for subtitle options) and mp_ass_reload_options() (update options) duplicated the code for setting some options. There is no reason why they shouldn't use the same code.
* options: move libass-related options to structUoti Urpala2011-09-031-38/+25
|
* subs: libass: apply option changes to all track typesUoti Urpala2011-08-081-5/+1
| | | | | | | | | Libass rendering uses two renderer objects to support both VSFilter aspect ratio (mis)behavior emulation and correct rendering. When option values were changed during playback the changes were applied to the renderer used for the currently active track only, and old values could be used if the user then switched to a track using the other renderer object. Fix to update both renderers.
* subs: libass: remove bad ass_set_margins() on settings resetUoti Urpala2011-08-081-1/+4
| | | | | | | | | | | When libass-related options were changed at runtime, the reinitilization code executed ass_set_margins() with arguments that were correct for the vf_ass case but wrong for EOSD. This could cause the subtitles to be displayed incorrectly for one frame (vf_vo would run ass_set_margins() again with the correct parameters for the next frame). The call is actually redundant for the vf_ass case too as it's currently not possible to modify the margins during playback, so fix the problem by disabling the call.
* cleanup: move global ass_force_reload to struct osd_stateUoti Urpala2011-08-081-11/+8
|
* subs: fix per-file --ass-force-styleUoti Urpala2011-07-231-2/+0
| | | | | | | | | | | | | The --ass-force-style option was only applied when the main libass library handle was created. Thus any per-file option changes later had no effect. Do the ass_set_style_overrides() call in per-file initialization instead so that possible changes will be applied. Also move the option variable to the option struct. Current libass will crash (usually) if you set style overrides to a nonempty value, then an empty one. It'll be easier to trigger this bug after this commit, but the problem is not on mplayer2 side. The fix is trivial so hopefully there will be a fixed libass soon.
* cleanup: subs: remove global ass_library variableUoti Urpala2011-07-231-1/+0
|
* sub/ass: use default style, not first style unconditionallyGrigori Goronzy2011-06-141-1/+2
| | | | | | | Turns out it's a bad idea to just always unconditionally use the first style. Make mplayer2 use and set the style according to the track's default_style property. Fixes the -ass-styles option broken with recent libass versions (ticket #40).
* stream.[ch], ass_mp: new stream function for whole-file readsUoti Urpala2011-03-031-34/+12
| | | | | | Add new stream_read_complete() function which reads the complete contents of file. Use that in ass_mp.c which had custom code to do the same.
* sub/OSD: move some related files to sub/Uoti Urpala2011-01-261-0/+355