Commit Graph

14 Commits

Author SHA1 Message Date
wm4 85a3a0d5bc osd: remove freetype font rendering code
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.
2012-07-28 23:36:08 +02:00
wm4 74e7a1e937 osd: use libass for OSD rendering
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.
2012-07-28 23:36:07 +02:00
wm4 87f4cafe9c Merge remote-tracking branch 'origin/master'
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.
2012-04-28 00:54:26 +02:00
Uoti Urpala b711624ef3 subs: only use "subfont.ttf" as libass fallback if it exists
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.
2012-04-14 03:51:19 +03:00
wm4 40300e3c0c ass_mp.c: remove code duplication
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.
2012-03-06 20:01:40 +01:00
Uoti Urpala 83fc5b6004 options: move libass-related options to struct 2011-09-03 14:26:14 +03:00
Uoti Urpala 8d1e5354e4 subs: libass: apply option changes to all track types
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.
2011-08-08 07:02:01 +03:00
Uoti Urpala f5d493d017 subs: libass: remove bad ass_set_margins() on settings reset
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.
2011-08-08 06:01:05 +03:00
Uoti Urpala 9920d64650 cleanup: move global ass_force_reload to struct osd_state 2011-08-08 05:59:23 +03:00
Uoti Urpala 99d9e56e27 subs: fix per-file --ass-force-style
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.
2011-07-23 05:35:26 +03:00
Uoti Urpala 91d6bca695 cleanup: subs: remove global ass_library variable 2011-07-23 01:55:13 +03:00
Grigori Goronzy 378ada847c sub/ass: use default style, not first style unconditionally
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).
2011-06-14 20:01:19 +03:00
Uoti Urpala 4c117849b3 stream.[ch], ass_mp: new stream function for whole-file reads
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.
2011-03-03 21:39:24 +02:00
Uoti Urpala c9026cb321 sub/OSD: move some related files to sub/ 2011-01-26 20:39:05 +02:00