summaryrefslogtreecommitdiffstats
path: root/sub
Commit message (Collapse)AuthorAgeFilesLines
* configure: remove --disable-sortsubwm42012-12-111-46/+4
| | | | | Apparently this was for debugging. There was a patch to remove it years ago, but it has been forgotten.
* sub: remove vobsub reader in favor of ffmpeg vobsub demuxerwm42012-12-115-1076/+29
| | | | | | | | ffmpeg recently added a demuxer that can read vobsubs (pairs of .sub and .idx files). Get rid of the internal vobsub reader, and use the ffmpeg demuxer instead. Sneak in an unrelated manpage change (autosub default).
* sub: clear libavformat demuxed subtitles on seekingwm42012-12-031-0/+6
| | | | | | libavformat demuxes ass subtitles in a broken way, that forces the player to throw away all subtitle events received so far. See mplayer svn commit 31293.
* subreader: fix some of ASS parser issuesUoti Urpala2012-12-031-45/+22
| | | | | | | | | | | | | | | | | | The subreader.c ASS parser (used when playing an external ASS subtitle file with --no-ass for "plaintext" display) hardcodes dialogue line syntax instead of correctly reading it from the "Format: " line in the file, but tried to support a varying amount of fields by guessing where the text field (which should be last) begins. This guessing code was buggy in many ways. Remove it and hardcode skipping 9 commas before the text field, which should work for most files. I don't consider the --no-ass case important enough to implement correct parsing now. Also fix the code removing formatting tags, which failed to remove the second in a pair of two consecutive tags. Conflicts: sub/subreader.c Merged from mplayer2 commit 91f516. Essentially reverts d5b964.
* subs: remove --utf8, simplify codeUoti Urpala2012-12-033-22/+5
| | | | | | | | | | | | | | | | | | | Remove the options --utf8 and --unicode which had no effect any more (what they once did should be doable with --subcp). The only use of corresponding variables left in code was subreader.c code using sub_utf8 as a flag indicating whether iconv conversion was active. Change the code to test the existence of iconv context instead. Conflicts: DOCS/man/en/options.rst core/cfg-mplayer.h sub/sub.c sub/sub.h sub/subreader.c Merged from mplayer2 commit ea7311. Note: --unicode was already removed
* video: add support for 12 and 14 bit YUV pixel formatsStephen Hutchinson2012-12-031-0/+8
| | | | | | | | | | | | Based on a patch by qyot27. Add the missing parts in mp_get_chroma_shift(), which allow allocation of such images, and which make vo_opengl automatically accept the new formats. Change the IMGFMT_IS_YUVP16_LE/BE macros to properly report IMGFMT_444P14 as supported: this pixel format has the highest numerical bit width identifier (0x55), which is not covered by the mask ~0xfc. Remove 1 bit from the mask (makes it 0xf8) so that IMGFMT_IS_YUVP16(IMGFMT_444P14) is 1. This is slightly risky, as the organization of the image format IDs (actually FourCCs + mplayer internal IDs) is messy at best, but it should be ok.
* subassconverter: correctly handle RRGGBB and unknow formatsStefano Pigozzi2012-11-251-22/+31
| | | | | | | The following HEX formats are now parsed correctly: `#RRGGBB`, `RRGGBB`. Moreover this implementation doesn't show the HTML on screen if the input color is not recognized. A warning is still displayed in the terminal.
* sub: add --sub-gray option to display image subs in grayscalewm42012-11-253-2/+42
| | | | | | | | | | MPlayer/mplayer2 still show DVD subtitles in gray. Depending on who you ask, this can be considered a bug or a feature. Include rendering in gray as explicit feature, so the user can decide what is better. This affects all indexed sub bitmaps entering the OSD rendering path. Currently, this means all image subs are affected by this option, but nothing else.
* sub: reimplement -spugauss as --sub-gausswm42012-11-253-0/+49
| | | | | | | | | | | | | | | | Apparently the -spugauss option was popular. The code originally implementing this is gone (scaler stuff in spudec.c). Reimplement it using libswscale to scale and blur image subtitles if the --sub-gauss option is set. The code does some rather lazy padding to allow the blur to spread pixels past the original image bounding box. (This problem exists with normal bilinear scaling too, but is barely noticable.) Technically, this doesn't just blur subtitles, but anything RGBA (or indexed) that enters the OSD rendering path. But only image subtitles produce these OSD formats currently, so no explicit check is done to prevent blurring in other cases.
* osd: fix z-order of subtitle OSD elementswm42012-11-221-2/+3
| | | | Subs should always be below OSD (meaning they have to be drawn first).
* draw_bmp: add RGB rendering to fix image quality issueswm42012-11-221-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As pointed out in commit ed01df, the quality loss due to frequent conversion between RGB and YUV is too much when drawing OSD and subtitles. Fix this by staying in the same colorspace when drawing subtitles. Render directly to RGB, without converting to YUV first. The bad thing about packed RGB is that there are many pixel formats, which would all require special code for blending. It's also completely incompatible to planar YUV. Use planar RGB instead, which allows us to reuse all code originally written for planar YUV. The only thing that needs to be changed is the color conversion in the libass case. (In exchange for simpler code, the image has to be copied, but this is still much better than converting to YUV.) Unfortunately, libswscale doesn't support planar RGB output. Add a hack to sws_utils.c to handle conversion to planar RGB. In the common case, when converting 32 bit per pixel RGB, calling swscale can be avoided entirely. The change in mp_image.c is needed to allocate GBRP images correctly. (The issue with vo_x11 could be easily solved by always backing up the same bounding box as the bitmap drawing RGB<->YUV conversion does, but this commit is probably the better fix.)
* subreader: do not skip the first char of ASS fields.cigaes2012-11-211-1/+1
| | | | | | | | | | | | Without this change, fields that can be sometimes empty and sometimes not, such as the Effect field, are counted in an inconsistent way. Since the number of fields is used to find where the text starts, it leads to internal field arriving on the video. Bug reported anonymously on the users mailing list. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35426 b3059339-0415-0410-9bf9-f77b7e298cf2
* vo_xv: don't require frame stepping to remove OSD or subswm42012-11-214-0/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | In order to improve performance, vo_xv didn't create a backup of the video frame before drawing OSD and subtitles during normal playback. It required the frontend to do frame stepping if it wanted to redraw the OSD, but no backup of the video frame was available. (Consider the following use case: enable the OSD permanently with --osd-level=3, then pause during playback and do something that shows an OSD message. The player will advance the video by one frame at the time the new OSD message is first drawn.) This also meant that taking a screenshot during playback with vo_xv would include OSD and subtitles in the resulting image. Fix this by always creating a backup before drawing OSD or subtitles. In order to avoid having to create a full copy of the whole image frame, introduce a complex scheme that tries to backup only the changed regions. It's unclear whether the additional complexity in draw_bmp.c for backing up only the changed areas of the frame is worth it. Possibly a simpler implementation would suffice, such as tracking only Y ranges of changed image data, or even just copying the full frame. vo_xv's get_screenshot() now always creates a copy in order not to modify the currently displayed frame.
* osd: make the OSD and sub font more customizablewm42012-11-205-69/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make more aspects of the OSD font customizable. This also affects the font used for unstyled subtitles (such as SRT), or when using the --no-ass option. This adds back some customizability that was lost with commit 74e7a1 (osd: use libass for OSD rendering). Removed options: --ass-border-color --ass-color --font --subfont --subfont-text-scale Added options: --osd-color --osd-border --osd-back-color --osd-shadow-color --osd-font --osd-font-size --osd-border-size --osd-margin-x --osd-margin-y --osd-shadow-offset --osd-spacing --sub-scale The font size is now specified in pixels as it would be rendered on a window with a height of 720 pixels. OSD and subtitles are always scaled with the window height, so specifying or expecting an absolute font size doesn't make sense. Such scaled pixel units are used to specify font border etc. as well. (Note: the font size is directly passed to libass. How the fonts are actually rasterized is outside of our control, but in theory ASS font sizes map to "script" pixels and then are scaled to screen size.) The default settings should be about the same, with slight difference due to rounding to the new scales. The OSD and subtitle fonts are not separately configurable. It has limited use and would double the number of newly added options, which would be more confusing than helpful. It could be easily added later, should the need arise. Other small details that change: - ASS_Style.Encoding is not set to -1 for subs anymore (assuming subs use VSFilter direction in -no-ass mode too) - use a different WrapStyle for OSD - ASS forced styles are not applied to OSD
* Fix potential bugs and issues, general cleanupsreimar2012-11-203-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of these are reimar fixing issues found by Coverity static analyzer, and possibly some more cleanup commits independent from this. Since these commits are rather noisy, squash them all together. Try to make code a bit clearer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35294 b3059339-0415-0410-9bf9-f77b7e298cf2 Conflicts: audio/out/ao_alsa.c Check the correct variable for NULL. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35323 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove pointless unreachable code (the loop condition already checks the 0xff case). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35325 b3059339-0415-0410-9bf9-f77b7e298cf2 Fix typo that might have caused reading beyond the string end. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35326 b3059339-0415-0410-9bf9-f77b7e298cf2 Do not needlessly use "long" types. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35331 b3059339-0415-0410-9bf9-f77b7e298cf2 Use AV_RB32 to avoid sign extension issues and validate offset before using it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35332 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove nonsense casts. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35343 b3059339-0415-0410-9bf9-f77b7e298cf2 Fix crash in case sh_audio allocation failed. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35348 b3059339-0415-0410-9bf9-f77b7e298cf2 Fix potential NULL dereference. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35351 b3059339-0415-0410-9bf9-f77b7e298cf2 Conflicts: libmpcodecs/ad_ffmpeg.c Note: Slightly modified. Fix malloc failure check to check the correct variable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35353 b3059339-0415-0410-9bf9-f77b7e298cf2 Avoid code duplication and pointless casts. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35363 b3059339-0415-0410-9bf9-f77b7e298cf2 Conflicts: stream/tv.c Error out if an invalid channel list name was specified instead of continuing and reading outside array bounds all over the place. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35364 b3059339-0415-0410-9bf9-f77b7e298cf2 Conflicts: stream/tv.c Make array "static const". git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35365 b3059339-0415-0410-9bf9-f77b7e298cf2 Properly free resources even when encountering many parse errors. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35367 b3059339-0415-0410-9bf9-f77b7e298cf2 Conflicts: parser-cfg.c Avoid leaks in error handling. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35380 b3059339-0415-0410-9bf9-f77b7e298cf2 Do not do sign comparisons on "char" type which can be both signed or unsigned. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35381 b3059339-0415-0410-9bf9-f77b7e298cf2 Free cookies file data after parsing it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35382 b3059339-0415-0410-9bf9-f77b7e298cf2 http_set_field only makes a copy of the string, so we still need to free it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35383 b3059339-0415-0410-9bf9-f77b7e298cf2 check4proxies does not modify input URL, so mark it const. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35390 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove proxy "support" from stream_rtp and stream_upd, trying to use a http proxy for UDP connections makes no sense. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35394 b3059339-0415-0410-9bf9-f77b7e298cf2 Conflicts: stream/stream_rtp.c stream/stream_udp.c Add url_new_with_proxy function to reduce code duplication and memleaks. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35395 b3059339-0415-0410-9bf9-f77b7e298cf2 Conflicts: stream/pnm.c stream/stream_live555.c stream/stream_nemesi.c stream/stream_rtsp.c Fix off-by-one errors in file descriptor validity checks. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35402 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove pointless cast. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35403 b3059339-0415-0410-9bf9-f77b7e298cf2 Abort when opening the file failed instead of calling "write" with an invalid descriptor. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35404 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove pointless local variable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35411 b3059339-0415-0410-9bf9-f77b7e298cf2 Conflicts: stream/http.c
* sd_ass: fix ASS subtitles coming from demux_lavfwm42012-11-161-3/+7
| | | | | libavformat demuxes ASS subtitles as complete ASS event, rather than Matroska-mangled events without time codes.
* subreader: replace sub_free() by talloc destructorwm42012-11-162-7/+7
| | | | Makes it less annoying to free the sub_data.
* clang: fix all warnings except deprecationsStefano Pigozzi2012-11-131-1/+1
|
* Rename directories, move files (step 2 of 2)wm42012-11-1214-46/+43
| | | | | | | | | | | | Finish renaming directories and moving files. Adjust all include statements to make the previous commit compile. The two commits are separate, because git is bad at tracking renames and content changes at the same time. Also take this as an opportunity to remove the separation between "common" and "mplayer" sources in the Makefile. ("common" used to be shared between mplayer and mencoder.)
* Merge branch 'osd_changes' into masterwm42012-11-0118-1447/+1282
|\ | | | | | | | | Conflicts: DOCS/man/en/options.rst
| * draw_bmp: remove swscale bug workaroundwm42012-11-011-3/+1
| | | | | | | | | | ffmpeg ticket #1852 is fixed with 425c30dda. This didn't actually happen in practice.
| * screenshot, draw_bmp: use colorspace passed with mp_imagewm42012-11-014-35/+53
| | | | | | | | | | Remove the explicit struct mp_csp_details parameters from all related functions, and use mp_image.colorspace/levels instead.
| * csputils: better support for integer color valueswm42012-10-282-2/+6
| |
| * draw_bmp, csputils: use function instead of macrowm42012-10-282-24/+7
| |
| * draw_bmp: cosmetics, refactorwm42012-10-283-434/+332
| | | | | | | | | | | | | | | | | | | | | | Mostly pedantic bikeshedding issues. Move some code around, so that the sub_bitmap_to_mp_images() function can be split into two parts. This is better than having a big function with many input and outputs, of which only half are used in each code path. Also, try to make code simpler by using a mp_rect type.
| * draw_bmp: remove CONDITIONAL2 codewm42012-10-241-25/+0
| | | | | | | | This was sometimes slower, sometimes slightly faster. Remove it.
| * Merge branch 'master' into osd_changeswm42012-10-241-2/+2
| |\ | | | | | | | | | | | | Conflicts: libvo/vo_xv.c
| * | options: remove --ffactor switchwm42012-10-244-11/+2
| | | | | | | | | | | | | | | | | | | | | This controlled the generation of the palette for DVD subs if no palette was found. The option name and description is confusing, and it was probably barely useful. Remove the option, and hardcode the behavior to the option's default value.
| * | options: remove --subfont-autoscale (changes default font scale)wm42012-10-244-31/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The code for this option attempted to emulate the old as-documented behavior. It wasn't very good at it, and now that the old OSD code has been removed, it's entirely pointless. This removes the factor 1.7 with which --subfont-text-scale was multiplied.
| * | options: remove subtitle related options that did nothingwm42012-10-244-24/+5
| | | | | | | | | | | | | | | | | | | | | Most of these cased working when the OSD was switched to libass, or didn't do anything even before that. Also don't recursively include subreader.h in sub.h.
| * | draw_bmp: fix IMGFMT_BGR32 useRudolf Polzer2012-10-241-9/+15
| | |
| * | sub: add clarifying commentswm42012-10-241-1/+3
| | |
| * | draw_bmp: fix for yuy2 formatwm42012-10-241-1/+2
| | | | | | | | | | | | | | | | | | | | | mp_get_chroma_shift() modifies its argument even if it fails, so we have to restore that. mp_image didn't set chroma shifts for yuy2.
| * | sub: simplify OSD redrawing logicwm42012-10-242-17/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally, we can redraw the OSD any time. But some drivers don't support OSD redrawing (vo_null etc.), or only "sometimes" (vo_xv). For that, some additional logic is needed. Simplify that logic. This might also fix subtle bugs with the OSD not updating or endless frame stepping in unforseen corner cases. Do this by adding a new flag, which tells whether the OSD should be redrawn. Remove some minor code duplication.
| * | VO, sub: refactorwm42012-10-2412-125/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove VFCTRL_DRAW_OSD, VFCAP_EOSD_FILTER, VFCAP_EOSD_RGBA, VFCAP_EOSD, VOCTRL_DRAW_EOSD, VOCTRL_GET_EOSD_RES, VOCTRL_QUERY_EOSD_FORMAT. Remove draw_osd_with_eosd(), which rendered the OSD by calling VOCTRL_DRAW_EOSD. Change VOs to call osd_draw() directly, which takes a callback as argument. (This basically works like the old OSD API, except multiple OSD bitmap formats are supported and caching is possible.) Remove all mentions of "eosd". It's simply "osd" now. Make OSD size per-OSD-object, as they can be different when using vf_sub. Include display_par/video_par in resolution change detection. Fix the issue with margin borders in vo_corevideo.
| * | draw_bmp: don't try to call swscale if image format not supportedwm42012-10-241-0/+3
| | | | | | | | | | | | If that happens, we silently fail.
| * | sub: add cache to mp_draw_sub_bitmaps()wm42012-10-244-19/+86
| | | | | | | | | | | | This caches scaled RGBA sub-bitmaps.
| * | sub, vf_ass: allow rendering RGBA subs, replace old vf_ass renderingwm42012-10-242-69/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do this by replacing all the old vf_ass drawing code by draw_bmp.c. Change sub.c to always use osd_draw() for the other OSD drawing routines, and simplify the code a bit. spudec.c subtitles (i.e. DVD subs) are now considered subtitles, and are rendered by vf_ass, if that filter is inserted.
| * | sub: fix text subtitle aspect ratio with vo_xv and vo_lavc, refactorwm42012-10-245-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes that vo_xv didn't display text subtitles correctly when using anamorphic video. It didn't pass the aspect information to the subtitle renderer. Also, try to render OSD correctly with respect to aspect ratio settings: on vo_xv, the OSD is rendered into the video, and needs to be "stretched" too when playing anamorphic video. When the -monitorpixelaspect option is used, even with VOs such as vo_opengl the OSD has to be rendered with that aspect ratio. As preparation for future commits, replace the weird vsfilter_scale value with a somewhat more sensible video_par member. Also, struct mp_eosd_res is a better place for the aspect rat