Commit Graph

428 Commits

Author SHA1 Message Date
wm4 6de8120822 Merge remote-tracking branch 'origin/master' into my_master
Conflicts:
	command.c
	mp_core.h
	mplayer.c
	screenshot.c
2012-03-16 19:14:44 +01:00
Uoti Urpala 7576885677 core: remove old EDL mode (--edl option)
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.
2012-03-09 20:48:54 +02:00
wm4 8dc0743571 Merge remote-tracking branch 'origin/master' into my_master
Conflicts:
	mplayer.c
	screenshot.c
2012-03-05 22:24:57 +01:00
wm4 12c44610ad screenshot: make screenshot filenames configurable
This adds the --screenshot-template option, which specifies a template
for the filename used for a screenshot. The '%' character is parsed as
format specifier. These format specifiers insert metadata into the
filename. For example, '%f' is replaced with the filename of the
currently played file.

The following format specifiers are available:

%n      Insert sequence number (padded with 4 zeros), e.g. "0002".
%0Nn    Like %n, but pad to N zeros (N = 0 to 9).
        %n behaves like %04n.
%#n     Like %n, but reset the sequence counter on every screenshot.
        (Useful if other parts in the template make the resulting
        filename already mostly unique.)
%#0Nn   Use %0Nn and %#n at the same time.
%f      Insert filename of the currently played video.
%F      Like %f, but with stripped file extension ("." and rest).
%p      Insert current playback time, in HH:MM:SS format.
%P      Like %p, but adds milliseconds: HH:MM:SS.mmmm
%tX     Insert the current local date/time, using the date format X.
        X is a single letter and is passed to strftime() as "%X".
        E.g. "%td" inserts the number of the current day.
%{prop} Insert the value of the slave property 'prop'.
        E.g. %{filename} is the same as %f. If the property doesn't
        exist or is not available, nothing is inserted, unless a
        fallback is specified as in %{prop:fallback text}.
%%      Insert the character '%'.

The strings inserted by format specifiers will be checked for
characters not allowed in filenames (including '/' and '\'), and
replaced with the placeholder '_'. (This doesn't happen for text that
was passed with the --screenshot-template option, and allows specifying
a screenshot target directory by prefixing the template with a relative
or absolute path.)
2012-02-29 04:14:54 +01:00
wm4 5fcd29eb40 core: rename --paused to --pause, and improve how pausing is done
Callign add_step_frame is not necessary, because mplayer always decodes
at least one frame when starting a new file. Calling pause_player is
sufficient, and unlike add_step_frame doesn't play any audio.
2012-02-29 03:07:10 +01:00
Uoti Urpala a43a4aafd0 configure, build: support compiling without libpostproc
libpostproc has been removed from Libav and the library now exists as
a separate project. Because it's not essential, separate it from the
Libav library check and allow compiling without it.
2012-02-27 18:18:49 +02:00
wm4 bbdff34d69 core: add option to start in paused state
The --paused option will start the player in paused state. That means it
will start out with a still image of the first frame.

This can be useful in combination with --ss to inspect a certain frame.

Caveat: this plays a small bit of audio at the start, which might be
perceived as an annoying artifact. This is because this is implemented
by frame stepping after initialization in order to decode and display
the first video frame.
2012-02-09 00:36:53 +01:00
wm4 316658ad48 screenshot: add png compression setting
The default compression setting is 7, which is hopefully a good balance
between speed of compression, and resulting file sizes. The maximum png
compression will be very slow even on fast computers. On the other hand,
the lowest compression setting produces files of several MB size with
normal video resolutions, which should be avoided as well.
2012-01-18 04:45:27 +01:00
wm4 09cdd1406d screenshot: add jpg support
The screenshot image file type can now be selected with the
--screenshot-filetype option. The --screenshot-jpeg-quality option
controls the compression setting of the written JPEG image file.
2012-01-18 04:45:22 +01:00
wm4 fee4d3b473 osd: add setting to display OSD always on terminal
Now the option --term-osd=force will cause mplayer to display all OSD
messages on the terminal, even if there is video.

Possible values for --term-osd:
- auto: use video OSD, or of there's no video, the terminal (default)
- off: always use video for OSD
- force: always use terminal for OSD

-term-osd and --term-osd are equivalent to --term-osd=force. This
changes the meaning of the option, since -term-osd used to enable the
OSD default behavior, i.e. --term-osd=auto.

-noterm-osd has the same effect as --term-osd=off, and is kept for
compatibility.

Implementation note:

The location for the OSD text was shared between the two code paths (it
was in osd_state.osd_text). We can't rely on the fact that the video-OSD
update code normally isn't run when --term-osd is called. When e.g.
panscan is updated, the video OSD code will draw the OSD anyway. This
would sometimes show unwanted OSD text on the video.

Deal with this by putting the current terminal-OSD text in a different
place (in MPContext.terminal_osd_text) to deal with this.
2012-01-18 04:33:30 +01:00
wm4 08e02fefad mplayer: remove ---help option
mplayer used to follow the convention of using a single dash ("-help") for
each option. For some reason "--help" was allowed as special case.

mplayer2 introduced a change to allow the more common convention with two
dashes ("--help"). This means that in combination with the old special
case for "--help", "---help" would suddenly be allowed.

Remove this special case.
2011-12-23 16:24:00 +01:00
Uoti Urpala 2e1cdcb9e6 configure, build: remove --disable-libav support
Remove support for building the player without libavcodec and
libavformat. These libraries are now always required.
2011-12-11 07:48:26 +02:00
Uoti Urpala 7b9908dda8 options, core/hrseek: add --hr-seek-demuxer-offset
Some demuxers do not accurately seek to a keyframe before a given
time but instead start too late. This means that precise seeks cannot
work either. Most notably the libavformat mpeg demuxer exhibits this
behavior depending on the file being played (with the internal mpeg
demuxer precise seeks don't work at all). Add new option
--hr-seek-demuxer-offset which can be used as a workaround with such
demuxers. The value of the option is subtracted from the seek target
position given to the demuxer when doing a precise seek.
2011-11-14 20:24:39 +02:00
Uoti Urpala 8b5efd6455 libmenu: remove OSD menu functionality (--menu)
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.
2011-10-25 07:05:47 +03:00
wm4 75eab4f72a video, options: implement better YUV->RGB conversion control
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.
2011-10-16 21:11:11 +03:00
Uoti Urpala 7042603136 options: --lavfdopts, --reuse-socket: remove "global" flag
--reuse-socket and --lavfdopts had the CONF_GLOBAL flag set. I see no
reason why they could not be set per file. Remove the flag from both
options.
2011-10-16 08:06:55 +03:00
Uoti Urpala d33f7cf6f2 options: --pphelp: fix after libpostproc version change
The last libpostproc major version change from 51 to 52 changed the
type of the "pp_help" symbol from a pointer to help text to the help
text itself. This made --pphelp crash. Change the option definition to
match the new type. This probably makes it crash if compiled against
older libpostproc, but the option is not important enough to try
supporting that (I've seen no reports of the crash, probably people
just don't use the option).
2011-09-04 21:34:11 +03:00
Uoti Urpala 89b37a32da options: add "disabled option" functionality
Add functionality to mark options that depend on features disabled at
compile time as disabled rather than not compiling the option
definitions at all. This allows printing a warning about the option
not being available because of a disabled feature, instead of just
"unknown option". Because the option definitions are still compiled
fully, this only works for definitions that do not reference symbols
which are not available if the feature is disabled. Use the new
functionality for options depending on libass.
2011-09-04 14:36:09 +03:00
Uoti Urpala 83fc5b6004 options: move libass-related options to struct 2011-09-03 14:26:14 +03:00
harklu 9e6933440a options, subs: add --ass-vsfilter-aspect-compat
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.
2011-08-12 14:19:10 +03:00
Uoti Urpala fada084499 options: remove old disabled options that just print an error
Remove several old options that were deprecated and disabled years ago
and whose only effect now was to show a custom error message about the
option in question being deprecated and then exit. Also remove the -vd
option which was just a stupid joke and never had useful functionality.
2011-08-09 03:28:32 +03:00
Uoti Urpala f25accbc51 core: improve --loop handling
Make per-file loop option start from --ss position, not always 0.
Do looping in more cases; before looping was only done when
encountering real end of file, now it also happens for example at
--endpos or --frames limits. Also move the --ss option to the option
struct.
2011-07-29 05:50:38 +03:00
Uoti Urpala 99d9e56e27 subs: fix per-file --ass-force-style
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.
2011-07-23 05:35:26 +03:00
Uoti Urpala 82b8f89bae input: rework event reading and command queuing
Rework much of the logic related to reading from event sources and
queuing commands. The two biggest architecture changes are:
- The code buffering keycodes in mp_fifo.c is gone. Instead key input
  is now immediately fed to input.c and interpreted as commands, and
  then the commands are buffered instead.
- mp_input_get_cmd() now always tries to read every available event
  from every event source and convert them to (buffered) commands.
  Before it would only process new events until one new command became
  available.

Some relevant behavior changes:
- Before commands could be lost when stream code called
  mp_input_check_interrupt() which read commands (to see if they were
  of types that triggered aborts during slow IO tasks) and then threw
  them away. This was especially an issue if cache was enabled and slow
  to read. Fixed - now it's possible to check whether there are queued
  commands which will abort playback of the current file without
  throwing other commands away.
- mp_input_check_interrupt() now prints a message if it returns
  true. This is especially useful because the failures caused by
  aborted stream reads can trigger error messages from other code that
  was doing the read; the new message makes it more obvious what the
  cause of the subsequent error messages is.
- It's now possible to again avoid making stdin non-blocking (which
  caused some issues) without reintroducing extra latency. The change
  will be done in a subsequent commit.
- Event sources that do not support select() should now have somewhat
  lower latency in certain situations as they will be checked both
  before and after select()/sleep in input reading; before the sleep
  always happened first even if such sources already had queued
  input. Before the key fifo was also handled in this manner (first
  key triggered select, but if multiple were read then rest could be
  delayed; however in most cases this didn't add latency in practice
  as after central code started doing command handling it queried for
  further commands with a max sleep time of 0).
- Key fifo limiting is more accurate now: it now counts actual
  commands intead of keycodes, and all queued keys are read
  immediately from input devices so they can be counted correctly.
- Since keypresses are now interpreted immediately, commands which
  change keybindings will no longer affect following keypresses that
  have already been read before the command is executed. This should
  not be an issue in practice with current keybinding behavior.
2011-07-17 07:36:09 +03:00
Clément Bœsch 2174cbfa2f cleanup: silence most of the clang warnings 2011-07-09 04:23:24 +03:00
reimar 2d23841739 options: Allow a larger range for -aspect
Based on patch by Steaphan Greene [sgreene cs.binghamton.edu]

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33688 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 13:01:07 +03:00
Uoti Urpala 7e65428712 Merge branch 'mplayer1_changes' 2011-05-02 00:46:03 +03:00
reimar e617653265 options: Add dummy -shuffle option to show it in -list-options
Add dummy -shuffle and -noshuffle options so they appear in
-list-options output. These features are not implemented as options;
rather they're features of the command line parser.

Also add the CONF_NOCFG flag to the existing playlist option, which is
a similar placeholder for a command line parser feature.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33147 b3059339-0415-0410-9bf9-f77b7e298cf2

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33148 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
Clément Bœsch 79bb565038 options: merge cfg-mplayer.h and cfg-common.h
Remove obsolete extern declarations for demuxer_type,
audio_demuxer_type, sub_demuxer_type and noconfig_opts in the
process.
2011-04-20 04:22:53 +03:00
Clément Bœsch 4587f030cc options: move sub_name, sub_auto and vobsub_name to struct 2011-04-20 04:22:52 +03:00
cehoyos cb61c0f2d4 options: add -gamma (was only accessible from slave mode before)
Patch by Kevin DeKorte, kdekorte at gmail

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33064 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-04-13 03:15:42 +03:00
Uoti Urpala 7fe2856fd9 OSD: support displaying fractional part of current position
Add option -osd-fractions which enables display of fractional seconds
when showing the current playback time on OSD.

Based on a patch from Christian <herr.mitterlehner@gsmpaaiml.com> but
with several modifications.
2011-04-12 18:11:28 +03:00
Uoti Urpala fad3585ef4 options: remove CONF_OLD option flag
The resulting semantics of this flag are weird enough that they're
unlikely to be what is wanted in any situation. Remove the flag and
convert the two options using it, -screenw and -screenh, to use
CONF_NOSAVE instead. I'm not sure why those specific options had the
flag and if any flag is really needed, but I don't want to check in
detail now and using CONF_NOSAVE should keep about the same behavior
in practice.

A bit more detail about the weird behavior this flag had:

When not using file groups, the flag had the same behavior as
CONF_NOSAVE, namely that when switching files the option would not be
reset to the global value (only possible file-specific settings were
applied). When using file groups, group-specific options would apply
to the _first two_ files in the group, but for the rest after the
first two, settings would not be reset when changing files (wtf?).
This was a result of the following sequence:
1) push higher-level settings, enter group
2) apply group-specific settings
3) push settings before applying ones specific to file 1 in group
4) apply file 1 settings, play file 1
5) pop settings to return to group settings
6) push settings before applying ones specific to file 2
7) apply file 2 settings
8) pop settings

Here the option was set at 2). 3) saved it because it had been set
after last push, so 5) restored the setting and it was used for file 2
too. However 6) no longer saved it because there had been pushes after
the original setting in 2), thus 8) no longer restored the setting and
the option was no longer forced to any particular value when playing
further files after that.
2011-01-31 21:53:05 +02:00
Uoti Urpala 4ea60a3d0e options: mark -fs with CONF_NOSAVE to keep state between files
Most of the time users want to keep current fullscreen state when
switching to another file, rather than always resetting to the global
default that was determined when the command line was parsed. Add the
CONF_NOSAVE flag to the -fs option to achieve this. The change means
that the fullscreen state from the previous file is kept unless there
is an explicit file-specific -fs or -nofs setting for the new file
(or in case file groups are used, moving to the new file enters a
group with explicitly specified state).
2011-01-31 21:15:59 +02:00
Uoti Urpala f923fd720c options: remove unused "func_full" option type
vo_zr was the last user of the "func_full" option type. I think it's
better if future features are implemented using more straightforward
option functionality. Delete the func_full implementation.
2011-01-31 16:03:11 +02:00
Uoti Urpala 626d5ed628 vo_zr2: drop Zoran support
There were multiple files specific to Zoran support, and they also
depended on internal FFmpeg headers (so it would probably have been
hard to get them to compile now even if you tried). It's obsolete now,
so just drop the whole mess.
2011-01-31 16:03:11 +02:00
Uoti Urpala b138ca43ca vo_dxr2, ao_dxr2: drop dxr2 support
dxr2 support had been broken quite a while and nobody noticed. There
were finally commits to fix it in the svn repo, but rather than apply
those I'll just drop dxr2 support.
2011-01-31 16:03:10 +02:00
Uoti Urpala 6d534cd3cb vidix: drop VIDIX support
By now VIDIX is too obscure to justify the amount of code and
complexity it requires in the sources. Although there is no pressing
need to drop it just now from a code point of view, I'll rather remove
it before release than release with VIDIX support and then drop it
later.

Some of the manpage mentions of VIDIX were in "this option supported
for these VOs" lists that looked outdated and failed to mention vdpau
for example. Replace such incorrect lists with a generic "not
supported for all VOs" mention.
2011-01-31 16:03:10 +02:00
Uoti Urpala f50f34245e Merge branch 'sub'
* 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
2011-01-26 20:42:15 +02:00
Clément Bœsch 83f37b54de cleanup: remove unused MEncoder-related code
Remove some code and variables that were no longer used after MEncoder
removal. Also remove some MEncoder references in comments.
2011-01-25 02:29:31 +02:00
Uoti Urpala 8636eb77c5 options: add special -leak-report option
Add a special option "-leak-report" that enables talloc leak
reporting.  It only works if it's given as the first argument.

The code abuses the CONF_TYPE_PRINT option type to make main option
parsing ignore the option. The parser incorrectly consumed the
following commandline argument as a "parameter" for options of this
type when they had the flag to not exit after printing the message.
Fix this. It makes no difference for any previously existing option I
think.
2011-01-15 22:36:27 +02:00
Uoti Urpala f0649f13d6 core: add support for precise non-keyframe-limited seeks
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.
2010-12-20 19:02:16 +02:00
Uoti Urpala 7e366113f7 options: add "choice" option type, use for -pts-association-mode
Add a "choice" option type. Options of this type take a string as
input and set an int option variable to the value corresponding to the
string. The string->int mapping is option-specific and is given in the
option definition. Strings not found in the mapping are rejected as
invalid option values.

Change the option -pts-association-mode to use this new option type
and accept values "auto, decoder, sort" instead of "0, 1, 2". The
change in accepted values shouldn't cause problems as this option is
not appropriate to use in normal user config files.
2010-12-18 10:14:25 +02:00
Uoti Urpala 7001c2d994 core: ordered chapters: add heuristic for merging inaccurate chapters
Some Matroska files have inaccurate ordered chapter endpoints, and so
parts where one chapter should end and the next begin at the same
timestamp were not merged. This resulted in an unnecessary seek over a
minimal distance. Add a heuristic to merge parts with a minimal gap or
overlap between them.

Based on patch by Hector Martin <hector@marcansoft.com>.
2010-11-26 16:58:10 +02:00
Clément Bœsch 7eb48343d4 options: more mplayer.c options moved to option struct
Following options were moved: autoq, benchmark, [no]term-osd,
term-osd-esc, playing-msg, [no]idle, [no]consolecontrols,
list-properties.
2010-11-14 00:14:56 +02:00
Clément Bœsch 9a9a7feafe options: move various mplayer.c options to option struct
Following options were moved: [no]quiet, [no]autosync, softsleep,
[no]rtc, rtc-device.
2010-11-13 23:06:33 +02:00
Uoti Urpala a4ce95de81 core: do initial A-V sync by modifying audio stream
Add code to enforce matching pts with video when (re)starting the
audio stream, by either cutting away the first samples or inserting
silence at the beginning. New option -noinitial-audio-sync can be used
to disable this and return to old behavior.
2010-11-13 19:46:02 +02:00
Uoti Urpala 3d999246e4 audio: add -gapless-audio option
If the option is enabled and all audio has been buffered to the AO,
then the player will move to the next file without waiting for the
buffered audio to drain, while leaving the AO initialized. If the
playback of the next file starts quickly enough (before the AO buffer
empties) then it should continue writing audio to the same AO with no
gap in between.
2010-11-12 18:29:09 +02:00
Clément Bœsch a3124a4f5d options: add OPT_MAKE_FLAGS macro, creates "opt/noopt" flag pair 2010-11-04 06:44:12 +02:00
Clément Bœsch 952f9b85a7 options: move -name and -title to option struct 2010-11-04 05:54:12 +02:00