summaryrefslogtreecommitdiffstats
path: root/sub
Commit message (Collapse)AuthorAgeFilesLines
* subs, vo_vdpau: support RGBA color for PGS subtitlesUoti Urpala2012-09-185-12/+143
| | | | | | | | | | | | | | | | | | | | | | Support passing bitmap subtitles to VOs in full RGBA color, and implement this for libavcodec-decoded subtitle formats on decoding side and vo_vdpau on display side. Currently this is enabled for PGS (blu-ray) and DVB subtitles. VDPAU seems to have sampling issues similar to known GL ones when drawing a sub-rectangle from a larger texture with scaling, where adjacent pixels outside the specified source rectangle affect the result. As the bitmap subtitles may be scaled, add padding support to the bitmap packer code. In principle, this could be used for colored DVD subtitles too. However, the libavcodec DVD decoder lacks parts of the resolution and palette handling that are present in spudec.c. Conflicts: libvo/vo_gl.c sub/dec_sub.h sub/sd_lavc.c
* options: remove -subalignwm42012-09-182-2/+0
| | | | | | 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.
* subs: restore support for sub_step command with libasswm42012-09-182-0/+14
| | | | | | This was destroyed by Uoti Urpala in commit "subs: always use sub...". Features should be either kept working or completely removed, but not just crippled, which only inflates the code and frustrates users.
* subs, vo: do sub bitmap change detection by comparing IDsUoti Urpala2012-09-184-9/+22
| | | | | | | | | | | | | | | | | vo_vdpau and vo_gl cache the last subtitle bitmaps uploaded to video card in case they stay the same over multiple frames. Detecting whether the bitmaps have changed and should be re-uploaded was somewhat fragile. Change the VO API to provide a bitmap ID which can be compared with what the VO has to determine whether a new upload of the bitmaps is needed. Conflicts: libvo/vo_gl.c Note: the changes for vo_gl.c were not merged. Instead, eosd_packer is modified to use the new way of detecting EOSD changes. This takes care of vo_gl, vo_gl3 and vo_direct3d, which all render EOSD. They don't need to be updated in turn.
* subs: always use sub decoder framework for libass renderingUoti Urpala2012-09-188-27/+98
| | | | | | | | | | | | | | | | | | | | | 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
* subs: libass: use a single persistent renderer for subtitlesUoti Urpala2012-09-185-26/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To draw libass subtitles, the code used ASS_Renderer objects created in vf_vo (VO rendering) or vf_ass. They were destroyed and recreated together with the video filter chain. Change the code to use a single persistent renderer instance stored in the main osd_state struct. Because libass seems to misbehave if fonts are changed while a renderer exists (even if ass_set_fonts() is called on the renderer afterwards), the renderer is recreated after adding embedded fonts. The known benefits are simpler code and avoiding delays when switching between timeline parts from different files (libass fontconfig initialization, needed when creating a new renderer, can take a long time in some cases; switching between files rebuilds the video filter chain, and this required recreating the renderers). On the other hand, I'm not sure whether this could cause inefficient bitmap caching in libass; explicitly resetting the renderer in some cases could be beneficial. The new code does not keep the distinction of separate renderers for vsfilter munged aspect vs normal; this means that changing subtitle tracks can lose cache for the previous track. The new code always sets some libass parameters on each rendering call, which were previously only set if they had potentially changed. This should be harmless as libass itself has checks to see if the values differ from previous ones. Conflicts: command.c libmpcodecs/vf_ass.c libmpcodecs/vf_vo.c mplayer.c sub/ass_mp.c
* sd_lavc: use subtitle framework for former av_sub.c codeUoti Urpala2012-09-185-94/+72
| | | | | | | | | | | | | | | | Change libavcodec subtitle decoding code (used for some bitmap subtitle types) to use the same decoding framework as sd_ass. The functionality that was previously in av_sub.c and was directly called from mplayer.c is now in sd_lavc.c. Conflicts: mplayer.c sub/av_sub.h sub/sd_lavc.c Merged from mplayer2. The remaining use of is_av_sub() is replaced by a check whether a subtitle decoder is active, which should give the same results.
* core: manage tracks in the frontendwm42012-09-183-1/+8
| | | | | | | | | | | | | | | 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.
* osd_libass: fix displaying empty text, fix API usagewm42012-08-211-11/+6
| | | | | | | | | | | | | | If empty text is rendered, the bounding box is empty. Instead of continuing with a bogus bounding box that would result in garbage being rendered on screen, make the OSD image invisible. This happened when playing demuxer SRT subtitles (e.g. SRT embedded in MKV) with -no-ass at the moment a subtitle line disappeared. Unrelated to this issue, fix libass API usage. Delete the event with libass_flush_events(), instead of trying to reuse the previous event. Based on a patch by uau.
* Adjust ffmpeg/libav #includes to work with recent upstream changesUoti Urpala2012-08-211-1/+1
| | | | | | | | The <libavutil/avutil.h> stopped including <libavutil/common.h> recursively in recent ffmpeg/libav git revisions. As a result, some files no longer got needed definitions, causing a build failure. Modify #include lines in various files to fix build with the latest versions of ffmpeg/libav headers.
* osd: get rid of useless initialization functionwm42012-08-201-9/+1
| | | | | The function merely printed redundant messages that were not visible by default.
* sub: remove unused definitionswm42012-08-201-12/+0
|
* Remove dvdnav support (DVD menus)wm42012-08-162-68/+0
| | | | | | | | | | | | | | | | 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.
* sub: fix confusion of ass_library handleswm42012-08-073-11/+14
| | | | | | | | | | | | Commit 7484ae8e2ee5327 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).
* osd_libass: allocate separate ASS_Library for OSDwm42012-08-073-5/+9
| | | | | | | | | | 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.
* osd: reset OSD change state even if VO doesn't draw OSDwm42012-08-072-0/+10
| | | | | | | | | | | | Commit 168293e0ae6f08 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.)
* VO: remove old VO gluewm42012-08-073-18/+2
| | | | | | | This transition to a new VO API started over 4 years ago. It's time to finally end it, and get rid of the horrible hacks. Also removes some previously undetected dead code from spudec.c.
* osd: free buffer allocated with av_malloc with av_freewm42012-08-041-4/+4
| | | | | | | | 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.)
* sub: simplify code by always defining sub_cpwm42012-08-032-5/+3
|
* 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
* spudec: use more precise alpha handling for -spuaa 4mplayer-svn2012-08-031-2/+2
| | | | | | | Use more precise alpha handling for -spuaa 4. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34874 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* av_sub, spudec: support multiple rectanglesmplayer-svn2012-08-033-41/+113
| | | | | | | | | | av_sub: support multiple rectangles. The "packet_t" structure is renamed with a prefix, because it is used a public header. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34872 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: cigaes
* subreader: eliminate duplicate subtitle linesmplayer-svn2012-08-031-0/+10
| | | | | | | | Eliminate duplicate subtitle lines which will most likely be artefacts from ASS effects. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34574 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* subreader: SSA reader: do not strip commas in commandsmplayer-svn2012-08-031-0/+3
| | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34573 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* subreader: fix reading of aqr/subrip09 subtitlesmplayer-svn2012-08-031-8/+8
| | | | | | | | | NULL return would indicate EOF, thus the "clear subtitle" entries would cause sub file parsing to stop. In addition the wrong sub end times would be used with CONFIG_SORTSUB. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33993 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* subreader: get rid of some code duplicationmplayer-svn2012-08-031-64/+34
| | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33992 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* Remove teletext supportwm42012-08-034-31/+0
| | | | | | | | 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.
* osd: minor simplification of vo_osd_changed()wm42012-08-012-11/+20
| | | | | | | | | | | | | | | | | | 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.
* Remove dead codewm42012-08-0110-986/+0
| | | | | | | | | | | | | 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
* configure: remove checks for malloc.h and alloca()wm42012-07-301-3/+0
| | | | | | | | 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().
* configure: remove memalign checkwm42012-07-301-3/+5
| | | | | Also, replace the only use of memalign: use av_malloc instead in sub.c. (av_malloc allocates with the required alignment restrictions.)
* 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).
* sub: silence output of subtitle search messagewm42012-07-301-1/+1
| | | | This message is not so interesting.
* sub: remove unrar_execwm42012-07-303-466/+0
| | | | | This removes the ability to open compressed bitmap subtitles from rar files. The code makes me afraid, and I never needed this feature.
* bstr: rename bstr() function to bstr0(), and typedef bstr to struct bstrwm42012-07-282-15/+15
| | | | | Replace all uses of bstr() with bstr0(). Also remove the ridiculous C++ workaround.
* osd: osd_font.h -> osd_font.pfbwm42012-07-283-546/+3
| | | | | | osd_font.pfb is an actual font file extracted from osd_font.h. file2string.py is used to turn it back into a header during the build process.
* osd: remove freetype font rendering codewm42012-07-2810-2703/+52
| | | | | | | | | | | | 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-2810-970/+1440
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* osd: enable line breaking for OSD textwm42012-07-281-31/+67
| | | | | | | | 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.
* Merge remote-tracking branch 'origin/master'wm42012-05-201-1/+1
|\
| * font_load_ft.c: fix possible crash with recent FontconfigUoti Urpala2012-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | Calling FcFontMatch with last argument NULL triggers an assertion failure in latest libfontconfig (2.9.0). Change the code to use a dummy address, like another nearby call to FcFontMatch already did. Whether the code triggering the assertion failure was run depended on font settings and/or available system fonts (the code looks like you'd have to get a non-scalable font first). Thus it didn't usually happen even with problematic libfontconfig version.
* | Merge remote-tracking branch 'origin/master'wm42012-04-291-33/+34
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bstr.c bstr.h libvo/cocoa_common.m libvo/gl_common.c libvo/video_out.c mplayer.c screenshot.c sub/subassconvert.c Merge of cocoa_common.m done by pigoz. Picking my version of screenshot.c. The fix in commit aadf1002f8a will be redone in a follow-up commit, as the original commit causes too many conflicts with the work done locally in this branch, and other work in progress.
| * 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.
* | 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.
* | subassconvert: handle unquoted attributes in subrip font tagswm42012-04-161-27/+45
| | | | | | | | | | Previously, mplayer didn't convert tags like <font color=#00FF00>. But such subtitles exist in the wild, and should be handled.
* | Merge remote-tracking branch 'origin/master'wm42012-04-011-0/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bstr.c bstr.h etc/input.conf input/input.c input/input.h libao2/ao_pulse.c libmpcodecs/vf_ass.c libmpcodecs/vf_vo.c libvo/gl_common.c libvo/x11_common.c mixer.c mixer.h mplayer.c
| * timeline: subs: keep subtitle tracks in source timeUoti Urpala2012-03-251-0/+1
| | | | | | | | | | | | | | | | | | | |