Commit Graph

22 Commits

Author SHA1 Message Date
wm4 f97a85595b options: remove -subalign
It can't be re-implemented, because this isn't supported by libass. The
-subalign option and the associated sub-align slave property did
nothing. Remove them.
2012-09-18 21:07:29 +02:00
Uoti Urpala 89a5714893 subs: always use sub decoder framework for libass rendering
Remove subtitle selection code setting osd->ass_track directly and
vf_ass/vf_vo code rendering the track directly with libass. Instead,
do track selection and rendering with dec_sub.c functions.

Before, mpctx->set_of_ass_tracks[] contained bare libass tracks
generated from external subtitle files. For use with dec_sub.c, it now
contains struct sh_sub instances with decoder already initialized.

This commit breaks the sub_step command ('g' and 'y' keys) for
libass-rendered subtitles. It could be fixed, but it's so useless -
especially as with the existing implementation there's no practical
way to get subtitle delay back to normal after using it - that I
didn't bother.

Conflicts:
	command.c
	mp_core.h
	mplayer.c
2012-09-18 21:04:46 +02:00
wm4 0f155921b0 core: manage tracks in the frontend
Introduce a general track struct for every audio/video/subtitle track
known to the frontend. External files (subtitles) are now represented
as tracks too. This mainly serves to clean up the subtitle selection
code: now every subtitle is simply a track, instead of using a messy
numbering that goes by subtitle type (as it was stored in the
global_sub_pos field). The mplayer fontend will list external subtitle
files as additional tracks.

The timeline code now tries to match the exact demuxer IDs of all
tracks. This may cause problems when Matroska files with different
track numberings are used with EDL timelines. Change demux_lavf not
to set demuxer IDs, since most time they are not set.
2012-09-18 21:04:45 +02:00
wm4 988dad5fc7 osd: get rid of useless initialization function
The function merely printed redundant messages that were not visible by
default.
2012-08-20 15:36:05 +02:00
wm4 41fbcee1f5 Remove dvdnav support (DVD menus)
When the internal mplayer MPEG demuxer was removed (commit 1fde09db),
the default demuxer when using dvdnav was set to libavformat. Now it
turns out that this doesn't work with libavformat. It will terminate
playback right after the audio runs out (instead of looping it like the
video, or whatever it's supposed to do). I'm not sure what exactly the
problem is, but since 1. even mplayer-svn can't handle DVD menus
directly (missing highlights), 2. DVD menus are essentially worthless,
and 3. I don't directly watch DVDs, don't bother with it and remove it.

For basic playback, there's still libdvdread support.

Also, use pkg-config for libdvdread, and drop support for in-tree
libdvdread. Remove support for in-tree libdvdcss as well.
2012-08-16 17:17:49 +02:00
wm4 fb563de255 sub: fix confusion of ass_library handles
Commit 7484ae8e2e attempted to introduce two ass_library handles
(as it was needed to deal with how ass_library manages fonts), but the
commit was completely bogus: it assumed osd_state->ass_library would be
used by osd_libass.c only, which is not the case. As result, some of the
subtitle code used the wrong ass_library handle.

We need two ass_library handles in osd_state. The one from the mplayer
core for subtitles (osd_state->ass_library), and one for OSD rendering
(osd_state->osd_ass_library).
2012-08-07 19:21:46 +02:00
wm4 7484ae8e2e osd_libass: allocate separate ASS_Library for OSD
osd_libass.c used the same ASS_Library object as the player core. This
caused a problem: when playing a new file, all fonts loaded by the
ASS_Library object were unloaded, including the OSD font. Parts of the
OSD would stop being rendered correctly.

Solve this by creating a separate ASS_Library, with its own set of
fonts.
2012-08-07 02:15:27 +02:00
wm4 0268b1a445 osd: reset OSD change state even if VO doesn't draw OSD
Commit 168293e0ae assumed the OSD drawing routines (which have the
functions osd_draw_text/_ext as entrypoint) would always be called, and
relied on that to reset the change flag.

Some VOs, such as vo_null, didn't do this. Pausing could turn into
endless framestepping in some cases. Restore the part of the OSD drawing
logic that dealt with this. (Alternatively, the VOs could be obliged to
always call the OSD drawing routines, even if the VO doesn't actually
draw the OSD. But it seems even more messy to rely on that.)
2012-08-07 01:58:43 +02:00
wm4 a62b9cf7a3 osd: free buffer allocated with av_malloc with av_free
free() was used before, which could in theory lead to crashes if
the OSD buffer was freed or resized. (Whether using free() actually
works depends on what function libavutil's av_malloc() uses internally.
On Linux, it seems to use memalign(), which uses free() as counterpart
for deallocation, so the bug never triggered for me.)
2012-08-04 22:22:37 +02:00
wm4 ebaaa41f2a Remove teletext support
Teletext requires special OSD support. Because I can't even test
teletext, I can't restore support for it. Since teletext can be
considered ancient and obscure, and since it doesn't make sense to keep
the remaining teletext code without being able to use it, I'm removing
it.
2012-08-03 00:12:46 +02:00
wm4 168293e0ae osd: minor simplification of vo_osd_changed()
vo_osd_changed() was a weird function: it was used both to query and
mutate state, which is a bad combination. The VOs used it to query
and reset the state, and the mplayer frontend mostly used it to set
the state. In some cases, the frontend did both (that code used a
variable "int hack" to backup the state and set it again).

Simplify it and make the VOs use a vo_osd_has_changed() function to
query whether the OSD bitmaps have to be recreated. vo_osd_changed()
on the other hand is now used to update state only. The OSD change
state is reset when osd_draw_text() is called.

Update vo_corevideo.m to use vo_osd_resized() as well (forgotten change
from libass-OSD merge).

Simplify osd_set_text() and its usages.
2012-08-01 18:23:28 +02:00
wm4 c92538dfaa Remove dead code
This was done with the help of callcatcher [1]. Only functions which
are statically known to be unused are removed.

Some unused functions are not removed yet, because they might be needed
in the near future (such as open_output_stream for the encode branch).

There is one user visible change: the --subcc option did nothing, and is
removed with this commit.

[1] http://www.skynet.ie/~caolan/Packages/callcatcher.html
2012-08-01 17:07:35 +02:00
wm4 6e8633c734 configure: remove checks for malloc.h and alloca()
Including <malloc.h>, especially if all you want is malloc(), has no
legitimate uses (on sane platforms at least). Remove the check for it,
and remove all uses in the code.

Remove unused check for alloca().
2012-07-30 22:14:33 +02:00
wm4 261243496e configure: remove memalign check
Also, replace the only use of memalign: use av_malloc instead in sub.c.
(av_malloc allocates with the required alignment restrictions.)
2012-07-30 22:14:33 +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 ac771d288d osd: enable line breaking for OSD text
OSD text wider than the window will be broken to fit the width. The line
breaking algorithm is naive and intended as temporary, until the OSD
render code is possibly replaced by "something better".

Newline characters are also considered.
2012-07-28 20:57:37 +02:00
harklu d4b8d1486a core: allocate OSD text buffers dynamically
The OSD text buffers (mp_osd_msg_t.text and osd_state.text) used to be
static arrays, with the buffer sizes spread all over the code as magic
constants. Make the buffers dynamically allocated and remove the
arbitrary length limits.
2011-08-09 03:28:58 +03:00
Clément Bœsch b68f9fef32 cleanup: shut up more warnings 2011-05-06 18:33:16 +03:00
Clément Bœsch 52743acba3 cleanup: avoid various GCC warnings 2011-04-20 04:22:53 +03:00
diego 30f9c5cd2b cleanup: remove some casts of memalign() return value
Do not pointlessly cast the return value of memalign().
memalign() returns void*, which is compatible with any pointer in C.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32850 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-02-15 19:20:37 +02:00
Uoti Urpala f50f34245e Merge branch 'sub'
* sub:
  sub/OSD: move some related files to sub/
  subtitles: options: enable -ass by default
  subtitles: change default libass rendering style
  demux_mkv, chapters: change millisecond arithmetic to ns
  cleanup: rename ass_* functions to mp_ass_*
  subs: use correct font aspect ratio for libass + converted subs
  cleanup: some random minor code simplification and cleanup
  vf_vo: fix EOSD change detection bug
  sd_ass: remove subreader use, support plaintext markup
  subtitles: style support for common SubRip tags and MicroDVD
  core: ordered chapters: fix bad subtitle parameter
  subs/demux: don't try to enable sub track when creating it
  subtitles/demux: store duration instead of endpts in demux packets
  subtitles: add framework for subtitle decoders
  options: add special -leak-report option
  subtitles: remove code trying to handle text subs with libavcodec
  cleanup: move MP_NOPTS_VALUE definition to mpcommon.h
  subtitles: move global ass_track to struct osd_state
  core: move most mpcommon.c contents to mplayer.c
  core: move global "subdata" and "vo_sub_last" to mpctx
  subtitles: remove sub_last_pts hack
  options: move -noconfig to option struct, simplify
2011-01-26 20:42:15 +02:00
Uoti Urpala c9026cb321 sub/OSD: move some related files to sub/ 2011-01-26 20:39:05 +02:00