summaryrefslogtreecommitdiffstats
path: root/sub
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | sub: create sub_bitmap array even when using libasswm42012-10-164-18/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One sub_bitmaps struct could contain either a libass ASS_Image list, or a mplayer native list of sub-bitmaps. This caused code duplication in vo_vdpau.c and bitmap_packer.c. Avoid this by creating such a sub_bitmap array even with libass. This basically copies the list and recreates it in mplayer's native format. It gets rid of the code duplication, and will make implementing extended subtitle and OSD rendering in other VOs easier. Also do some cosmetic changes and other preparations for the following commits.
* | | | subreader: do not write outside array boundsreimar2012-10-311-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Extra checks to ensure we really do not write outside array bounds. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35313 b3059339-0415-0410-9bf9-f77b7e298cf2
* | | | spudec: set pointers to NULL after freereimar2012-10-311-0/+2
| |_|/ |/| | | | | | | | | | | | | | | | | | | | Set pointers to NULL after free. For the pal_image one it would have been possible to leak the old pointer of the malloc for "image" failed. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35303 b3059339-0415-0410-9bf9-f77b7e298cf2
* | | osd_libass: increase robustness when handling internal OSD escapeswm42012-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The \xFF escape is used internally to insert special OSD symbols (which need a font change to the internal OSD font). There was potential for breakage when \xFF was followed by \0, because then "in" would be advanced past the string's end. Normally this can't happen, as it would require invalid UTF-8 input data. But we don't check input for UTF-8 validness, so there's a potential issue here. Garbled output is ok on invalid UTF-8 input, but crashing is not. Make it more robust by checking for this.
* | | osd_libass: fix stupid dangling pointer crashwm42012-10-221-1/+1
| |/ |/| | | | | | | | | | | | | | | | | append_utf8_buffer() reallocates the buffer passed to it, and returns the new pointer. This bug was originally introduced in mplayer2 when that project merged mpv's osd_libass.c. That merge changed some minor things, including ASS escape handling. When mpv used this better method of escape handling too (commit 0ff7dd992fb0), the bug was duplicated.
* | osd_libass: fix \n escapeswm42012-10-141-8/+3
| | | | | | | | | | | | | | | | | | Apparently libass can't be made to not interpret "\n" as escape. That means "\n" can't be printed literally. Use the same hack that was added to mplayer2 when that project merged osd_libass.c: add an invisible zero-width joiner character between "\" and "n". It seems U+FEFF is deprecated, because it has been redefined as BOM mark. Use U+2060, which seems to be the replacement.
* | sub: add --ass-style-override option to disable style overrideswm42012-10-122-13/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a number of options which modify ASS subtitle rendering. Most of these do things that can interfere with the styling done by subtitle scripts, resulting in incorrect rendering. Add the --ass-style-override option to make it easy to disable all overrides. This helps trouble- shooting, and makes it more practical to use the override features. (You can simply toggle the ass-style-override property at runtime, should one of the style override options break subtitle rendering at a certain point.) This mainly affects whether most --ass-* options are applied, as well as --sub-pos. Some things, like explicit style overrides loaded with --ass-force-style, can't be changed at runtime using the ass-style-override property.
* | sub: enable sub-pos with libasswm42012-10-122-1/+6
|/ | | | | | | | | | The --sub-pos option and sub-pos property control the vertical position of a subtitle. Also change how sub-pos is handled in the old subtitle renderer (used with -no-ass). The new behavior doesn't render subtitles out of the screen if the subtitle is located near the top screen border and has too many lines.
* 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