summaryrefslogtreecommitdiffstats
path: root/mplayer.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename directories, move files (step 1 of 2) (does not compile)wm42012-11-121-4302/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tis drops the silly lib prefixes, and attempts to organize the tree in a more logical way. Make the top-level directory less cluttered as well. Renames the following directories: libaf -> audio/filter libao2 -> audio/out libvo -> video/out libmpdemux -> demux Split libmpcodecs: vf* -> video/filter vd*, dec_video.* -> video/decode mp_image*, img_format*, ... -> video/ ad*, dec_audio.* -> audio/decode libaf/format.* is moved to audio/ - this is similar to how mp_image.* is located in video/. Move most top-level .c/.h files to core. (talloc.c/.h is left on top- level, because it's external.) Park some of the more annoying files in compat/. Some of these are relicts from the time mplayer used ffmpeg internals. sub/ is not split, because it's too much of a mess (subtitle code is mixed with OSD display and rendering). Maybe the organization of core is not ideal: it mixes playback core (like mplayer.c) and utility helpers (like bstr.c/h). Should the need arise, the playback core will be moved somewhere else, while core contains all helper and common code.
* Merge branch 'osd_changes' into masterwm42012-11-011-83/+51
|\ | | | | | | | | Conflicts: DOCS/man/en/options.rst
| * Merge branch 'master' into osd_changeswm42012-10-241-14/+8
| |\ | | | | | | | | | | | | Conflicts: libvo/vo_xv.c
| * | options: remove --ffactor switchwm42012-10-241-1/+0
| | | | | | | | | | | | | | | | | | | | | 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.
| * | core: disable vf_sub auto-insertionwm42012-10-241-32/+0
| | | | | | | | | | | | | | | | | | | | | Since most VOs support rendering subs directly, this doesn't change much. Changes include: vo_null is faster, vo_image doesn't add subtitles by default (while vo_lavc does), vo_caca doesn't render subs (but you couldn't read them anyway).
| * | VF: rename vf_ass to vf_subwm42012-10-241-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reflects the fact that this filter now renders all types of subtitles, not just ASS subtitles. Always compile this filter, not just on CONFIG_ASS. Note that --no-ass still disables auto-inserting this filter. It's the only way to disable auto-insertion, so keep it even though it's not really ASS specific anymore. --no-ass also disables using libass for rendering text subs directly.
| * | core: do not try to redraw OSD if VO doesn't support OSDwm42012-10-241-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes awkward framestepping when seeking with -vo null while paused (caused because seeking by default draws an OSD bar, and mplayer trying to redraw the OSD in that case; this logic is actually needed with vo_xv). It would have been simpler to just check vo->driver->draw_osd (and leave that callback to NULL for VOs which don't support OSD), but for now try to retain the capability to let VOs decide based on the image format whether to support OSD or not.
| * | sub: simplify OSD redrawing logicwm42012-10-241-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-241-16/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | core: fix -subfilewm42012-10-241-3/+6
| | | | | | | | | | | | | | | When demux_demuxers was removed, and -subfile was moved to the frontend, setting the non_interleaved for -subfile was forgotten.
| * | Merge branch 'master' into osd_changeswm42012-10-161-191/+117
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Makefile command.c libvo/gl_common.c libvo/vo_corevideo.m libvo/vo_opengl.c libvo/vo_opengl_old.c libvo/vo_opengl_shaders.glsl sub/ass_mp.c sub/osd_libass.c sub/sd_ass.c
| * | | sub: always go through sub.c for OSD renderingwm42012-10-161-12/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, vf_vo.c and vf_ass.c were manually calling the subtitle decoder to retrieve images to render. In particular, this circumvented the sub-bitmap conversion & caching layer in sub.c. Change this so that subtitle decoding isn't special anymore, and draws all subtitles with the normal OSD drawing API. This is also a step towards removing the need for vf_ass auto-insertion. In fact, if auto-insertion would be disabled now, VOs with "old" OSD rendering could still render ASS subtitles in monochrome, because there is still ASS -> old-OSD bitmap conversion in the sub.c mechanism. The code is written with the assumption that the subtitle rendering filter (vf_ass) can render all subtitle formats. Since vf_ass knows the ASS format only, rendering image subs (i.e. RGBA subs) with it simply fails. This means that with vo_xv (vf_ass auto-inserted), image subs wouldn't be rendered. Use a dumb hack to disable rendering subs with a filter, if we detect that the subs are not in ASS format. (Trying to render the subs first would probably result in purging the conversion cache on every frame.)
| * | | sub: make it easier to set DVD sub decoding with sd_lavcwm42012-10-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this commit, the player will still use spudec.c (the "old" DVD sub decoder), rather than ffmpeg. But it brings the changes needed to enable this down to a single line change: --- a/mplayer.c +++ b/mplayer.c @@ -1988,7 +1988,7 @@ static void reinit_subs(struct MPContext *mpctx) #endif vo_osd_changed(OSDTYPE_SUBTITLE); } else if (track->stream) { - if (mpctx->sh_sub->type == 'v') + if (mpctx->sh_sub->type == 'v' && false) init_vo_spudec(mpctx); else sub_init(mpctx->sh_sub, mpctx->osd); Also, copy the DVD resolution heuristics from spudec.c (from the spudec_new_scaled() function). I'm not sure if this is correct or even needed, but the sd_lavc codd explicitly reverted back to spudec with code carrying this comment: // Assume resolution heuristics only work for PGS and DVB so it seems likely that the required heuristics were missing, and that the spudec heuristics may make the DVD compatibility situation at least as good as with spudec. Note that it's unlikely that we enable sd_lavc for DVD subs by default, as there are other problems in combination with direct DVD playback.
| * | | sub: cleanup: remove vo_osd_probar_type/value global variableswm42012-10-161-3/+3
| | | |
| * | | mplayer: reset subtitles handled by dec_sub.c on seekwm42012-10-161-0/+2
| | | | | | | | | | | | | | | | This was somehow lost when merging this.
| * | | sub: create sub_bitmap array even when using libasswm42012-10-161-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | mplayer: remove useless timer callswm42012-11-011-5/+1
| | | | | | | | | | | | | | | | | | | | GetTimer() has no side-effects. Probably left over from --benchmark removal.
* | | | mplayer: mark exit_player as noreturnwm42012-10-311-1/+3
| | | | | | | | | | | | | | | | Similar to mplayer-svn commit r35291.
* | | | mplayer: fix multiline terminal OSDwm42012-10-301-0/+3
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an OSD message printed to the terminal was multiple lines, the second line overwrote the status line. If that second line was shorter than the status line, awkward looking remains of the status line were left on the terminal. Fix this by writing an empty status line before printing the OSD message. This will clear the status line text. Also, print the status line again after the OSD message is printed - this makes output consistent with the single-line OSD message case. Remaining caveat: only the last line of a multiline OSD message is cleared when the OSD message is removed. But this is probably fine.
* | | mplayer: make terminal status playback time consistent with OSDwm42012-10-211-14/+8
| |/ |/| | | | | | | | | | | | | Always use the same function as the OSD does (get_current_time()). This loses the logic to display "???" if the time is unknown, as get_current_time() returns 0 in this case. (The function has far too many uses to change that now, and it seems to happen rarely in practice.)
* | core: show quvi page title in window title, clean up libquvi handlingwm42012-10-141-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up handling of libquvi (which resolves URLs of streaming sites into URLs to the actual media playable by mpv). Move the code out of open.c to quvi.c, and invoke it explicitly from mplayer.c, instead of trying to resolve every filename passed to open_stream(). This allows easily passing metadata from the quvi context to the frontend. Expose QUVIPROP_PAGETITLE as "media-title" property, and use that instead of "filename" for the mplayer window title. (For YouTube, this is the video title.) It's cleaner too. Handle a potential reliability issue: check quvi_getprop return values. Since open.c contains barely anything but the open_stream() stub, move that to stream.c and delete open.c.
* | Merge branch 'input_changes' into masterwm42012-10-121-172/+80
|\ \ | | | | | | | | | | | | | | | | | | | | | Conflicts: DOCS/man/en/vo.rst etc/input.conf input/input.c m_property.c
| * | sub: add --ass-style-override option to disable style overrideswm42012-10-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | options: add --status-msgwm42012-10-121-22/+35
| | | | | | | | | | | | | | | | | | | | | Replaces the status line with a custom string. This is probably useful for hacking old slave mode applications into working again. Even if not, this might be generally useful.
| * | commands: more user-control whether a command shows OSD bars/messageswm42012-10-121-13/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "no-osd" prefix was introduced earlier to disable OSD selectively based on the key binding. Extend this, and allow the user to force display of an OSD bar ("osd-bar"), OSD message ("osd-msg") or both ("osd-msg-bar"). This changes mainly how property setting functions behave. The default behavior is still the same.
| * | commands: change property expansion format stringwm42012-10-121-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This affects property format strings like they are used in the "show_text" input command, for --playing-msg, and other places. To quote the documentation comment on m_properties_expand_string(): ${NAME} is expanded to the value of property NAME. If NAME starts with '=', use the raw value of the property. ${NAME:STR} expands to the property, or STR if the property is not available. ${?NAME:STR} expands to STR if the property is available. ${!NAME:STR} expands to STR if the property is not available. STR is recursively expanded using the same rules. "$$" can be used to escape "$", and "$}" to escape "}". "$>" disables parsing of "$" for the rest of the string. Most importantly, "?(property:str)" becomes "${?property:str}". Make the simple fallback case easier, e.g. "${property:fallback}" instead of "${property}?(!property:fallback)". Add the ability to escape the format meta characters. "$" is used for escaping, because escaping with "\" is taken by the commands parser in the layer below. "$>" can be used to disable interpretation of format strings (of course escapes by the commands parser can't be canceled). By default, properties which are unavailable or don't exist are turned into a string signaling the status (e.g. "(unavailable)"), instead of an empty string. If an empty string is desired, this has to be done explicitly: "${property:}" (the fallback part is an empty string). Raw properties still return an empty string on error. m_properties_expand_string() now returns a talloc'ed pointer, instead of a malloc'ed one.
| * | options: accept "yes" and "no" only for flagswm42012-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the alternative values like "off", "0", "false" etc., and also the non-English versions of these. This is done for general consistency. It's better to have a single way of doing things when multiple ways don't add singificant value. Also update some choices for consistency.
| * | options: remove CONF_TYPE_POSITIONwm42012-10-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This was the option parser for the off_t C type. These days, off_t is always int64_t, so replace all its uses by int64_t and CONF_TYPE_INT64. Fix the --sstep option. It used CONF_TYPE_INT with an off_t variable, which will result in invalid memory accesses. Make it use type double instead, which seems to make more sense for this option.
| * | commands: replace --hardframedrop, change framedropping propertywm42012-10-121-2/+1
| |