summaryrefslogtreecommitdiffstats
path: root/command.c
Commit message (Collapse)AuthorAgeFilesLines
* bstr: rename bstr() function to bstr0(), and typedef bstr to struct bstrwm42012-07-281-3/+3
| | | | | Replace all uses of bstr() with bstr0(). Also remove the ridiculous C++ workaround.
* osd: use libass for OSD renderingwm42012-07-281-13/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* commands: add show_tracks_osd command to display audio and subtitle tracks ↵wm42012-07-281-0/+82
| | | | | | | | | on OSD The command lists the audio and subtitle tracks in the current file on the OSD. It also marks the currently active streams. Video streams are not shown, as files with more than one video stream are exceedingly rare.
* commands: add show_chapters_osd command to display chapters on OSDwm42012-07-281-0/+41
| | | | | | | | The command lists the chapters in the current file on the OSD. It also marks the current chapter. This is actually a cheap replacement for the chapter select libmenu functionality.
* Merge remote-tracking branch 'origin/master'wm42012-04-281-7/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * audio: fix unmute-at-end logicUoti Urpala2012-04-111-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | The player tried to disable mute before exiting, so that if mute is emulated by setting volume to 0 and the volume setting is a system-global one, we don't leave it at 0. However, the logic doing this at process exit was flawed, as volume settings are handled by audio output instances and the audio output that set the mute state may have been closed earlier. Trying to write reliably working logic that restores volume at exit only would be tricky, so change the code to always unmute an audio driver before closing it and restore mute status if one is opened again later.
| * audio: restore balance setting after reinitUoti Urpala2012-04-111-3/+0
| | | | | | | | | | | | | | Restore the audio balance setting when the audio chain is reinitialized (also after switching to another file). Also add a note about the balance code being seriously buggy.
| * audio: keep volume level internally (not only in AO)Uoti Urpala2012-04-111-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current volume was always queried from the the audio output driver (or filter in case of --softvol). The only case where it was stored on mixer level was that when turning off mute, volume was set to the value it had before mute was activated. Change the mixer code to always store the current target volume internally. It still checks for significant changes from external sources and resets the internal value in that case. The main functionality changes are: Volume will now be kept separately from mute status. Increasing or decreasing volume will now change it relative to the original value before mute, even if mute is implemented by setting AO level volume to 0. Volume changes no longer automatically disable mute. The exception is relative changes up (like the volume increase key in default keybindings); that's the only case which still disables mute. Keeping the value internally avoids problems with granularity of possible volume values supported by AO. Increase/decrease keys could work unsymmetrically, or when specifying a smaller than default --volstep, even fail completely. In one case occurring in practice, if the AO only supports changing volume in steps of about 2 and rounds down the requested volume, then volume down key would decrease by 4 but volume up would increase by 2 (previous volume plus or minus the default change of 3, rounded down to a multiple of 2). Now, the internal value will keep full precision.
* | Merge remote-tracking branch 'origin/master'wm42012-04-011-1/+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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Timeline handling converted the pts values from demuxed subtitles to timeline scale. Change the code to do most subtitle handling in original subtitle source pts, and instead convert current playback timeline pts to those units when deciding which subtitle to show. The main functionality changes are that now demuxed subtitles which overlap chapter boundaries are handled correctly (at least for libass subtitles), and external subtitles are assumed to use same pts scale as current source (this needs improvements later). Before, a video subtitle that had a duration continuing past the end of the chapter would continue to be shown for the original duration, even if the chapter ended and playback switched to a position in the source where the subtitle shouldn't exist. Now, the subtitle will correctly end. Before, external subtitle files were interpreted as specifying pts values in timeline scale. Now, they're interpreted as specifying pts values in source file time scale, for _every_ source file. This is probably more likely to be what the user wants for the "main" source file in case there is one, but almost certainly not quite right for multiple source files where the same subs could be shown over different scenes. If the user wants them to match some main source file, it's probably still better to have incorrect extra subs for video from some files than to have every subtitle appearing at the wrong time. The new code makes it easier to change the interpretation of the subtitle times, and some configurability should be added in the future.
* | Merge remote-tracking branch 'origin/master' into my_masterwm42012-03-161-1/+1
|\| | | | | | | | | | | | | | | Conflicts: command.c mp_core.h mplayer.c screenshot.c
| * core: remove old EDL mode (--edl option)Uoti Urpala2012-03-091-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the old EDL implementation that was activated with the --edl option. It is mostly redundant and inferior compared to the newer demux_edl support, though currently there's no support for using the same EDL files with the new implementation and the mute functionality of the old implementation is not supported. The main reason to remove the old implementation at this point is that the mute functionality would conflict with following audio volume handling changes, and working on the old code would be a wasted effort in the long run as at some point it would be removed anyway. The --edlout functionality is kept for now, even though after this commit there is no code that could directly read its output.
| * cleanup: Silence compilation warnings on MinGW-w64wm42012-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the code, especially the dshow and windows codec loader parts, are extremely hacky and likely full of bugs. The goal is merely getting rid of warnings that could obscure more important warnings and actual bugs, instead of fixing actual problems. This reduces the number of warnings from over 500 to almost the same as when compiling on Linux. Note that many problems stem from using the ancient wine-derived windows headers. There are some differences to the "proper" windows header. Changing the code to compile with the proper headers would be too much trouble, and it still has to work on Unix. Some of the changes might actually break compilation on legacy MinGW, but we don't support that anymore. Always use MinGW-w64, even when compiling to 32 bit. Fixes some warnings in the win32 loader code on Linux too.
* | commands: add pt_clear command to clear playlistwm42012-02-101-0/+27
| | | | | | | | | | | | | | | | | | This deletes all playlist elements, except the currently active playlist entry. NOTE: this doesn't remove parent nodes in the case when we really have a play tree (as opposed to a play list). Apparently this doesn't cause any harm.
* | Merge branch 'softvol' into my_masterwm42012-01-181-20/+3
|\ \ | |/ |/|
| * core: remove EDL mutingwm42012-01-181-17/+0
| | | | | | | | | | | | I'm not sure what's the point of this feature. Aside from that, the EDL code is relatively buggy anyway, and I see no reason why such an obscure feature should be left in, if it possibly causes bugs.
| * audio: reset mplayer's mute state when the system mixer volume changeswm42012-01-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, the mute state was only reset when either mute was explicitly cleared, or the volume was changed via mplayer controls. If the volume controls are connected to the system mixer, and the system mixer volume is changed otherwise (e.g. with alsamixer), the mute setting was inconsistent. Avoid this by checking the volume. If the returned volume is not 0, the mute flag is considered invalid. This relies on system mixers always returning a volume of 0 when mplayer has set the volume 0. Possible caveat: if the audio output's volume control don't return a volume of exactly 0 after 0 was written, enabling mute basically won't work. It will set the volume to silence, forget the previous volume, and report that mute is disabled.
| * audio: properly restore audio volume on exit when mute is usedwm42012-01-181-2/+1
| | | | | | | | | | | | | | | | When you mute audio, mplayer is supposed to restore the volume controls on exit. This affects when --softvol isn't used and the audio output driver volume controls directly affect the system wide volume controls. This wasn't done in some cases.
* | osd: always display pause icon when frame steppingwm42012-01-091-2/+0
|/ | | | | | | When the OSD was enabled and the player was paused by executing the frame_step command, the OSD still displayed the icon indicating playback. Fix this and always set the proper icon when the pause state is changed.
* commands: playback speed: better responsiveness without audioUoti Urpala2011-12-061-3/+5
| | | | | | | | Adjust the scheduled time until next frame when changing playback speed (only affects behavior without audio). The main case where this makes a difference is when it would take a noticeably long time to switch frames with the previous speed and you switch to a faster speed.
* Merge branch 'screenshot' (early part)Uoti Urpala2011-11-251-9/+2
|\
| * core: add screenshot mode for actual VO window contentswm42011-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The screenshot command normally converts the currently displayed video frame to an image. Add support for an alternative screenshot mode that is supposed to capture the real window contents. Such a screenshot contains a possibly scaled version of the frame, the OSD, and subtitles. Add a default key binding Alt+s for taking screenshots in this mode. This needs special VO support, and might not work with all VOs (this commit does not yet contain an implementation for any VO, only the infrastructure).
| * core: add infrastructure to get screenshots from VOswm42011-11-251-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a VO command (VOCTRL_SCREENSHOT) which requests a screenshot directly from the VO. If VO support is available, screenshots will be taken instantly (no more 1 or 2 frames delay). Taking screenshots when hardware decoding is in use will also work (vdpau). Additionally, the screenshots will now use the same colorspace as the video display. Change the central MPContext to be allocated with talloc so that it can be used as a talloc parent context. This commit does not yet implement the functionality for any VO (added in subsequent commits). The old screenshot video filter is not needed anymore if VO support is present, and in that case will not be used even if it is present in the filter chain. If VO support is not available then the filter is used like before. Note that the filter still has some of the old problems, such as delaying the screenshot by at least 1 frame.
* | commands, vd_ffmpeg: fix switch_ratio slave commandUoti Urpala2011-11-141-1/+1
|/ | | | | | | | | The implementation of the switch_ratio command was hacky and called mpcodecs_config_vo() to reconfigure the filter/VO chain from under an existing decoder. This call no longer worked properly with vd_ffmpeg after that started using mpcodec_config_vo2(). Add new video decoder control command VDCTRL_RESET_ASPECT and use this to tell vd_ffmpeg to reinitialize the output chain properly.
* core, demux: fix --identify chapter output with ordered chapterswm42011-10-251-8/+6
| | | | | | | | | | | | | | | Information about individual chapters was printed during demuxer opening phase, and total chapter count (ID_CHAPTERS) was printed according to mpctx->demuxer->num_chapters. When playing a file with ordered chapters, this meant that chapter information about every source file was printed individually (even though only the chapters from the first file would be used for playback) and the total chapter count could be wrong. Remove the printing of chapter information from the demuxer layer and print the chapter information and count actually used for playback in core print_file_properties(). Also somewhat simplify the internal chapters API and remove possible inconsistencies.
* libmenu: remove OSD menu functionality (--menu)Uoti Urpala2011-10-251-11/+0
| | | | | | | | | | Something like the OSD menu functionality could be useful. However the current implementation has several problems and would require a relatively large amount of work to get into good shape. As far as I know there are few users of the existing functionality. Nobody is working on the existing code and keeping it compiling at all while changing other code would require extra work. So delete the menu code and some related code elsewhere that's used by nothing else.
* video, options: implement better YUV->RGB conversion controlwm42011-10-161-33/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite control of the colorspace and input/output level parameters used in YUV-RGB conversions, replacing VO-specific suboptions with new common options and adding configuration support to more cases. Add new option --colormatrix which selects the colorspace the original video is assumed to have in YUV->RGB conversions. The default behavior changes from assuming BT.601 to colorspace autoselection between BT.601 and BT.709 using a simple heuristic based on video size. Add new options --colormatrix-input-range and --colormatrix-output-range which select input YUV and output RGB range. Disable the previously existing VO-specific colorspace and level conversion suboptions in vo_gl and vo_vdpau. Remove the "yuv_colorspace" property and replace it with one named "colormatrix" and semantics matching the new option. Add new properties matching the options for level conversion. Colorspace selection is currently supported by vo_gl, vo_vdpau, vo_xv and vf_scale, and all can change it at runtime (previously only vo_vdpau and vo_xv could). vo_vdpau now uses the same conversion matrix generation as vo_gl instead of libvdpau functionality; the main functional difference is that the "contrast" equalizer control behaves somewhat differently (it scales the Y component around 1/2 instead of around 0, so that contrast 0 makes the image gray rather than black). vo_xv does not support level conversion. vf_scale supports range setting for input, but always outputs full-range RGB. The value of the slave properties is the policy setting used for conversions. This means they can be set to any value regardless of whether the current VO supports that value or whether there currently even is any video. Possibly separate properties could be added to query the conversion actually used at the moment, if any. Because the colorspace and level settings are now set with a single VF/VO control call, the return value of that is no longer used to signal whether all the settings are actually supported. Instead code should set all the details it can support, and ignore the rest. The core will use GET_YUV_COLORSPACE to check which colorspace details have been set and which not. In other words, the return value for SET_YUV_COLORSPACE only signals whether any kind of YUV colorspace conversion handling exists at all, and VOs have to take care to return the actual state with GET_YUV_COLORSPACE instead. To be changed in later commits: add missing option documentation.
* options: move libass-related options to structUoti Urpala2011-09-031-5/+6
|
* options, subs: add --ass-vsfilter-aspect-compatharklu2011-08-121-0/+25
| | | | | | | | | Add option --ass-vsfilter-aspect-compat and corresponding property ass_vsfilter_aspect_compat. The setting controls whether to enable the emulation of traditional VSFilter behavior where subtitles are stretched if the video is anamorphic (previously always enabled for native SSA/ASS subtitles). Enabled by default. Add 'V' as a new default keybinding to toggle the property.
* core: allocate OSD text buffers dynamicallyharklu2011-08-091-2/+2
| | | | | | | 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.
* cleanup: move global ass_force_reload to struct osd_stateUoti Urpala2011-08-081-3/+3
|
* commands: property sub_scale: update old subs immediatelyharklu2011-08-081-0/+2
| | | | | | When using the "old" subtitle renderer (i.e. not libass), changes to this property were not reflected immediately, and came into effect only when the next subtitle event was rendered.
* cleanup: reformat command.cUoti Urpala2011-08-071-1022/+1014
|
* options: commandline: accept --foo=xyz style optionsUoti Urpala2011-07-291-1/+2
| | | | | | | | | | | | Allow writing commandline options with two leading dashes. In this mode a parameter for the option, if any, follows after a '='; following separate commandline arguments are never consumed as a parameter to a previous double-dash option. Flag options may omit parameter and behave like old single-dash syntax. "--fs=yes", "--fs=no" and "--fs" are all valid; the first two behave like configuration file "fs=yes" and "fs=no", and last is the same as old "-fs" (same effect as "--fs=yes").
* options: change option parsing to use bstrUoti Urpala2011-07-291-1/+2
| | | | | | Using bstr allows simpler parsing code, especially because it avoids the need to modify or copy strings just to terminate extracted substrings.
* cleanup: remove some unnecessary input.[ch] typedefsUoti Urpala2011-07-161-2/+2
| | | | | | | | | | | | Remove some unnecessary typedefs and remove pointless mp_ prefix from some internal struct names. Change the type of the "close_func" pointers from "void f(int fd)" to "int f(int fd)" so that using standard close() there is valid. Delete some useless assert() statements. Move internal MP_MAX_KEY_DOWN define from input.h to input.c.
* OSD: when switching sub/audio tracks show title of new trackUoti Urpala2011-07-031-9/+20
| | | | | | If the played file has per-track titles for audio and subtitles show those on the OSD when switching tracks. This changes the OSD message from 'Audio: (2) eng' to 'Audio: (2) eng ("Director's commentary")'.
* commands: change property mechanism to use talloc stringsUoti Urpala2011-07-031-63/+52
|
* command.c: Add missing osdep/strsep.h #includediego2011-06-291-0/+1
| | | | | | | | The include is needed on systems without native strsep(). based on a patch by Stephen Sheldon, sfsheldo gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33338 b3059339-0415-0410-9bf9-f77b7e298cf2
* Merge branch 'mplayer1_changes'Uoti Urpala2011-05-021-0/+2
|\
| * commands: Fix DVD angle cycling upreimar2011-05-021-0/+2
| | | | | | | | | | | | Patch by 侯红勋 [houhongxun gmail com] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33317 b3059339-0415-0410-9bf9-f77b7e298cf2
* | command.c: fix sub_remove crashUoti Urpala2011-05-021-1/+8