summaryrefslogtreecommitdiffstats
path: root/command.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
| | | | | | | | | | The sub_remove slave command tried to access a NULL pointer when removing an external subtitle file displayed with libass. Fix.
* | audio: change external AO interface to "ao_[method](ao, ...)"Uoti Urpala2011-04-091-1/+1
|/ | | | | | | | Make the outside interface of audio output handling similar to the video output one. An AO object is first created, and then methods called with ao_[methodname](ao, args...). However internally libao2/ still holds all data in globals, and trying to create multiple simultaneous AO instances won't work.
* core, demux: fix video index handling in stream switchingUoti Urpala2011-03-311-15/+11
| | | | | | | | Fix bugs in the handling of stream index values in video stream switching. This is similar to what commit 90bedd0b872b6eea02351aafb62e did for audio. Also clean up the corresponding audio code a little bit.
* cleanup: define ROUND() macro in mpcommon.hcboesch2011-01-311-2/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32751 b3059339-0415-0410-9bf9-f77b7e298cf2
* commands: improve playback speed property/commandsUoti Urpala2011-01-281-19/+15
| | | | | | | Add a definition to show the playback speed property on screen, and change the separate commands (speed_mult etc) to use the property mechanism. Now 'set_property_osd speed' can show the value on OSD, and the separate commands respect the range limits of the option.
* sub/OSD: move some related files to sub/Uoti Urpala2011-01-261-5/+5
|
* subs: use correct font aspect ratio for libass + converted subsUoti Urpala2011-01-261-3/+8
| | | | | | | | | | | | | | | | | | | | | | 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.
* subtitles: add framework for subtitle decodersUoti Urpala2011-01-181-4/+6
| | | | | | | | | | 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.
* subtitles: move global ass_track to struct osd_stateUoti Urpala2011-01-151-14/+11
|
* core: move most mpcommon.c contents to mplayer.cUoti Urpala2011-01-151-1/+1
| | | | | | | | | | | | | | | | The contents of mpcommon.c were quite arbitrary; the most common reason to place some functions in this file had been "MEncoder happens to need similar code as MPlayer and we want to share some parts, but we have no clue whatsoever how to organize things in a sensible way, so we'll just dump those parts we want to share in mpcommon.c". As a result of containing an essentially random subset of top-level player functionality the mpcommon.h header required access to central structs and was unsuitable for inclusion in lower-level code, but was nonetheless included there for the mplayer_version symbol. Move almost all contents from mpcommon.c to mplayer.c. mplayer.c is already big and should perhaps be split further, but keeping a few random functions in mpcommon.c would not be an improvement.
* core: move global "subdata" and "vo_sub_last" to mpctxUoti Urpala2011-01-111-8/+9
|
* Merge branch 'hr-seek'Uoti Urpala2010-12-201-31/+60
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * hr-seek: input: add default keybindings Shift+[arrow] for small exact seeks input: support bindings with modifier keys for X input core: audio: make ogg missing audio timing workaround more complex core: add support for precise non-keyframe-limited seeks core: add struct for queued seek info commands: add generic option -> property wrapper options: add "choice" option type, use for -pts-association-mode core: remove looping in update_video(), modify command handling a bit core: seek: use accurate seek mode with audio-only files core: avoid using sh_video->pts as "current pts" libvo: register X11 connection fd in input event system core: timing: add special handling of long frame intervals core: move central play loop to a separate function Conflicts: DOCS/tech/slave.txt
| * core: add support for precise non-keyframe-limited seeksUoti Urpala2010-12-201-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Add support for seeking to an arbitrary non-keyframe position by decoding video starting from the previous keyframe. Whether to use this functionality when seeking is controlled by the new option -hr-seek and a new third argument to the "seek" command. The default is to use it for absolute seeks (like chapter seeks) but not for relative ones. Because there's currently no support for cutting encoded audio some desync is expected if encoded audio passthrough is used. Currently precise seeks always go to the first frame with timestamp equal to or greater than the target position; there's no support for "matching or earlier" backwards seeks at frame level.
| * core: add struct for queued seek infoUoti Urpala2010-12-201-20/+12
| | | | | | | | | | | | | | | | To prepare for the addition of exact seek support, add a struct for queued seek state and a helper function to update its state. It would have been cumbersome to update additional state (showing whether the seek is forced to be exact or non-exact) manually at every point that handles seeks.
| * commands: add generic option -> property wrapperUoti Urpala2010-12-181-0/+37
| | | | | | | | | | | | | | | | | | Add mp_property_generic_option(), a property function that can be used for generic option-based properties that do not require any action beyond manipulating the value of the option variable. Currently it directly implements GET and SET, plus STEP_UP for "choice" options only. Use it to add a property for -pts-association-mode (not particularly useful in normal use, but serves as a test).
| * core: avoid using sh_video->pts as "current pts"Uoti Urpala2010-12-141-7/+5
| | | | | | | | | | | | Add a new field "video_pts" to mpctx. It records the time of the last frame flipped visible on VO. Change various code which used sh_video->pts to use either the new field or get_current_time(mpctx).
* | commands: clean up get_metadata() and related code</