summaryrefslogtreecommitdiffstats
path: root/sub
Commit message (Collapse)AuthorAgeFilesLines
* Update Libav API usesUoti Urpala2012-02-011-2/+7
| | | | | | | | | | | | | | | | | | | Change various code to use the latest Libav API. The libavcodec error_recognition setting has been removed and replaced with different semantics. I removed the "--lavdopts=er=<value>" option accordingly, as I don't think it's widely enough used to be worth attempting to emulate the old option semantics using the new API. A new option with the new semantics can be added later if needed. Libav dropped APIs that were necessary with all Libav versions until quite recently (like setting avctx->age), and it would thus not be possible to keep compatibility with previous Libav versions without adding workarounds. The new APIs also had some bugs/limitations in the recent Libav release 0.8, and it would not work fully (at least some avcodec options would not be set correctly). Because of those issues, this commit makes no attempt to maintain compatibility with anything but the latest Libav git head. Hopefully the required fixes and improvements will be included in a following Libav point release.
* configure, build: require at least Libav 0.7Uoti Urpala2011-12-221-2/+0
| | | | | | | | | | | | | | | | Require versions of the Libav libraries corresponding to Libav release 0.7. These are: libavutil 51.7.0 libavcodec 53.5.0 libavformat 53.2.0 libswscale 2.0.0 libpostproc 52.0.0 Also disable the fallback to simple header check if these libraries could not be found with pkg-config; now compiling without pkg-config support for these always requires explicitly setting --enable-libav and any needed compiler/linker flags. The simple check would have let compilation proceed even if a version mismatch was detected.
* core, vo: modify OSD redraw architecture, support EOSDUoti Urpala2011-12-061-0/+1
| | | | | | | | | | | | | | | | Previously the core sent VFCTRL_REDRAW_OSD to change OSD contents over the current frame. Change this to VFCTRL_REDRAW_FRAME followed by normal EOSD and OSD drawing calls, then vo_flip_page(). The new version supports changing EOSD contents for libass-rendered subtitles and simplifies the redraw support code needed per VO. vo_xv doesn't support EOSD changes because it relies on vf_ass to render EOSD contents earlier in the filter chain. vo_xv logic is additionally simplified because the previous commit removed the need to track the status of current and next images separately (now each frame is guaranteed to become "visible" soon after we receive it as "next", with no VO code running in the interval between).
* subreader.c: don't run FriBiDi code if using libassUoti Urpala2011-09-231-1/+4
| | | | | | | | Libass has its own BiDi handling now, and preprocessing the subtitles with FriBiDi before passing them to libass breaks things. Disable our own FriBiDi code when libass rendering is used. This affects external subtitle files of other formats parsed with subreader.c and converted to ASS tracks.
* sd_ass.c: set event->Style to fix --ass-stylesUoti Urpala2011-09-231-0/+1
| | | | | | | | | | | | | Set the "Style" attribute for subtitle events created in sd_ass to match the "default_style" attribute of the track. This is required to make --ass-styles work with recent libass versions (otherwise the event would use style 0, which is a fallback style added by libass now). Commit 378ada847c8eb3a641392691b1a2317f8fc214e0 ("sub/ass: use default style, not first style unconditionally") fixed the same issue for external subtitles converted with mp_ass_read_subdata(); this commit fixes it for muxed ones.
* options: move libass-related options to structUoti Urpala2011-09-033-55/+33
|
* subassconvert: handle "\r\n" line endsClément Bœsch2011-09-021-1/+1
| | | | | | | | | Previously the code converting text subtitles to ASS format converted newline characters, and only those, to ASS "new line" markup. If the subtitles contained "\r\n", the "\r" was thus left in the text. In previous libass versions the "\r" was not visible, but in the current one it produces an empty box. Improve the conversion to remove the "\r" in that case. Also treat a lone "\r" as a newline.
* aviheader.h: avoid including demuxer.hUoti Urpala2011-08-192-0/+2
| | | | | | | Remove unnecessary demuxer.h include from aviheader.h. Through stheader.h aviheader.h is included in a lot of files. Add missing mp_msg.h includes to av_sub.c and sd_ass.c (previously hidden by indirect inclusion through demuxer.h and stream.h).
* core: allocate OSD text buffers dynamicallyharklu2011-08-092-1/+11
| | | | | | | 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.
* subs: libass: apply option changes to all track typesUoti Urpala2011-08-082-7/+2
| | | | | | | | | 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.
* subs: libass: remove bad ass_set_margins() on settings resetUoti Urpala2011-08-081-1/+4
| | | | | | | | | | | 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.
* cleanup: move global ass_force_reload to struct osd_stateUoti Urpala2011-08-083-14/+12
|
* bstr: rename BSTR() -> bstr()Uoti Urpala2011-07-271-13/+13
| | | | | | Rename the BSTR() function to bstr(). The former caused a conflict with some Windows OS name, and it's no longer a macro so uppercase naming is less appropriate.
* subs: fix per-file --ass-force-styleUoti Urpala2011-07-232-3/+0
| | | | | | | | | | | | | 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.
* cleanup: subs: remove global ass_library variableUoti Urpala2011-07-234-4/+3
|
* cleanup: do libav* initialization on startupUoti Urpala2011-07-181-2/+0
| | | | | | | Do the global initialization of libavcodec and libavformat (avcodec_register_all(), av_register_all()) immediately on program startup and remove the initialization calls from various individual modules that use libavcodec/libavformat functionality.
* cleanup: vobsub.c: simplify parsingcboesch2011-07-061-57/+10
| | | | | | | | | | vobsub: simplify timestamp parsing. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33601 b3059339-0415-0410-9bf9-f77b7e298cf2 vobsub: simplify origin parsing. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33602 b3059339-0415-0410-9bf9-f77b7e298cf2
* cosmetics: Fix typoscehoyos2011-07-061-4/+4
| | | | | | Patch by Mike Castle, dalgoda+mplayer gmail git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33575 b3059339-0415-0410-9bf9-f77b7e298cf2
* subreader: SAMI subs: wrap line if neededreimar2011-06-291-0/+2
| | | | | | | Start a new line if there's no space left to append to the previous one. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33471 b3059339-0415-0410-9bf9-f77b7e298cf2
* sub/ass: use default style, not first style unconditionallyGrigori Goronzy2011-06-141-1/+2
| | | | | | | 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).
* cleanup: shut up more warningsClément Bœsch2011-05-064-10/+11
|
* Merge branch 'mplayer1_changes'Uoti Urpala2011-05-021-0/+4
|\
| * sub/spudec: fix artefacts at right border of subtitlesreimar2011-05-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Fix artefacts at right border of scaled bitmap subtitles by clearing the destination to 0 first if the width is not a multiple of 8. This is necessary because some of the optimized sub drawing functions always draw pixels in multiples of 8, so we cannot rely on any "dirt" in the "unused" borders being ignored. Note that due to the way rendering works, both alpha and the image need to be cleared. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33230 b3059339-0415-0410-9bf9-f77b7e298cf2
* | find_subfiles: fix unintended modification of global filenameUoti Urpala2011-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | Commit a2d28010cc ("cleanup: find_subfiles.c: simplify (mainly using bstr)") was missing a bstrdup() in subtitle search code, and thus the code erroneously modified the original filename string passed in. As a result anything which printed or otherwise used the filename after that would use a lowercase-converted version instead of the actual file name. Fix by adding the bstrdup() to operate on a local copy of the name instead.
* | cleanup: avoid various GCC warningsClément Bœsch2011-04-201-1/+1
| |
* | cleanup: find_subfiles.c: simplify (mainly using bstr)Uoti Urpala2011-04-201-156/+113
| |
* | cleanup: find_subfiles.c: simplify declarations and allocationsClément Bœsch2011-04-201-36/+25
| | | | | | | | | | Also clarify compare_sub_priority() and remove a typedef for the subfn structure in the process.
* | find_subfiles: select subtitle files matching -slangClément Bœsch2011-04-201-57/+59
| | | | | | | | Also simplify subtitle selection a bit.
* | find_subfiles: try to determine if a .sub file is text or vobsubClément Bœsch2011-04-201-0/+14
| | | | | | | | | | | | | | A file with the ambiguous extension .sub could be either VOBsub or MicroDVD. If there's a corresponding .idx file it's certainly VOBsub, so don't add it to the list of potential text subtitles. This will avoid the annoying warning "SUB: Could not determine file format".
* | subs: options: add -sub-pathsClément Bœsch2011-04-202-5/+29
| |
* | find_subfiles: allow subtitle search in multiple directoriesClément Bœsch2011-04-201-117/+103
| |
* | subs: move vobsub loading logic down to find_subfiles.cUoti Urpala2011-04-202-0/+26
| | | | | | | | | | | | | | Analogously to the previous commit, move path handling logic for loading external vobsub files from mplayer.c to find_subfiles.c. Based on a commit from Clément Bœsch but fixed and simplified.
* | subs: move text sub loading logic down to find_subfiles.cClément Bœsch2011-04-202-2/+11
| | | | | | | | | | | | Move path handling for loading external subtitle files from mplayer.c to find_subfiles.c. Now the remaining code in mplayer.c only gets a list of potential filenames and tries opening those.
* | find_subfiles: move sub_filenames() hereClément Bœsch2011-04-204-283/+297
| | | | | | | | | | | | | | | | | | | | Move sub_filenames() and related code from subreader.c to new file find_subfiles.c. This function is used to find subtitle files that should be loaded for the current video; this functionality is not specific to the particular kind of text subtitle handling implemented in subreader.c. Also reindent and prettify the moved code a bit.
* | options: change -alang and -slang to use string list typeClément Bœsch2011-04-202-5/+7
| | | | | | | | | | | | | | | | | | There is no reason to use manual language list splitting when an automatic split function is already available. Some types change from "unsigned char" to "char", but this shouldn't cause issues since [as]lang settings are unlikely to have characters above 127.
* | stream.[ch], ass_mp: new stream function for whole-file readsUoti Urpala2011-03-031-34/+12
|/ | | | | | 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.
* cleanup: remove some casts of memalign() return valuediego2011-02-151-2/+2
| | | | | | | 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
* Merge branch 'sub'Uoti Urpala2011-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* sub/OSD: move some related files to sub/Uoti Urpala2011-01-2622-1/+10677
|
* cleanup: rename ass_* functions to mp_ass_*Uoti Urpala2011-01-261-1/+1
| | | | | | | | The various ass_* functions were created when libass was part of the MPlayer tree and the distinction between MPlayer-specific and other functions was less clear. Now that libass is a clearly separate library, using the same ass_* namespace for player functions is ugly. Rename the functions to use mp_ass_ prefix instead.
* subs: use correct font aspect ratio for libass + converted subsUoti Urpala2011-01-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | Rendering of ASS subtitles tries to be bug compatible with VSFilter and stretches fonts when the video is anamorphic (some scripts try to compensate for this VSFilter behavior, so trying to render them "correctly" would give the wrong result). However this behavior is not appropriate for subtitles we converted to ASS format ourselves for libass rendering, as they certainly don't have VSFilter bug workarounds. Change the code to use different behavior for "native" ASS tracks and converted ones. It's questionable whether the VSFilter-compatible behavior is appropriate for external .ass files either, as there could be anamorphic and non-anamorphic versions of the same video and the bug-compatible behavior can only be correct for one alternative at most. However it's probably better to keep it as a default at least, so that extracting a muxed subtitle track and using that does not give behavior different from the original muxed one. The aspect ratio setting is per ASS_Renderer, and changing it resets libass caches. For that reason this commit adds separate renderer instances to use for the "correct" and "VSFilter bug compatible" cases.
* sd_ass: remove subreader use, support plaintext markupUoti Urpala2011-01-181-12/+66
| | | | | | | | | | | Originally, when rendering plaintext subs with libass, the subtitles were first converted to the "struct subtitle" form with sub_add_text() and then from that to libass events. Change sd_ass to convert the subtitles directly to libass events without using the old sub machinery. The new conversion at least fixes some timing issues. Also use the markup support added in the previous commit, so that HTML-style markup is also supported in "plaintext" subs rendered with libass.
* subtitles: style support for common SubRip tags and MicroDVDUoti Urpala2011-01-182-0/+529
| | | | | | | | | | | SubRip subtitles have no "official" spec for any styling support, but various tags are in common use; previous code filtered out text between <> to remove HTML-style tags. Add support for those tags and for MicroDVD subtitle styling. The style display is implemented by converting the subtitles to the ASS subtitle format and displaying them with libass, so libass needs to be enabled. Original patch by Clément Bœsch <ubitux@gmail.com>.
* subtitles: add framework for subtitle decodersUoti Urpala2011-01-184-0/+200
Add a framework for subtitle decoder modules that work more like audio/video decoders do, and change libass rendering of demuxed subtitles to use the new framework. The old subtitle code is messy, with details specific to handling particular subtitle types spread over high-level code. This should make it easier to clean things up and fix some bugs/limitations.