Commit Graph

63 Commits

Author SHA1 Message Date
wm4 425ac31a3b softvol, ao_pulse: prefer ao_pulse volume control by default
--softvol is enabled by default. For most audio outputs, this is a good
thing, as they have either their own (bad) soft volume implementation,
or control the system mixer. With ao_pulse, the situation is a bit
different: it supports per-application volume (i.e. volume control is
not really global). More importantly, ao_pulse uses a rather large audio
buffer, and changing the volume with mplayer's volume filter has a large
delay. With the native ao_pulse volume control, it's instant, because
PulseAudio's audio filtering happens at a later stage in its processing
pipeline (inaccessible for mplayer).

This means native volume control should really be allowed for ao_pulse,
while it's the reverse for other audio outputs. Make --softvol a choice
option, and add a new "auto" choice. This is default and will use PA's
volume control with ao_pulse, and mplayer's volume filter otherwise
(i.e. the old softvol behavior).
2012-09-23 14:57:01 +02:00
wm4 65adad50ab mplayer: unbreak OSD with CONFIG_ENCODING undefined
Basically, the encoding code path wanted to set osdlevel=0 as default,
while normal playback needs osdlevel=1. For this purpose, osdlevel was
set to -1 (i.e. invalid) initially to detect whether the --osdlevel
option was explicitly set. When encoding was not configured
(CONFIG_ENCODING undefined), the osdlevel value was not set from
-1 to 1 properly, and the OSD remained invisible by default.

Fix this by getting rid of this logic. It shouldn't be needed, since
osdlevel=1 never shows any OSD messages without user interaction.
Should this ever change, we could still check whether encoding is in
progress, or add another option to allow OSD rendering during encoding.
2012-09-18 21:08:20 +02:00
Rudolf Polzer f5b8b6ac12 encode: video encoding now supported using mencoder-like options 2012-09-18 21:08:20 +02:00
Uoti Urpala 89a5714893 subs: always use sub decoder framework for libass rendering
Remove subtitle selection code setting osd->ass_track directly and
vf_ass/vf_vo code rendering the track directly with libass. Instead,
do track selection and rendering with dec_sub.c functions.

Before, mpctx->set_of_ass_tracks[] contained bare libass tracks
generated from external subtitle files. For use with dec_sub.c, it now
contains struct sh_sub instances with decoder already initialized.

This commit breaks the sub_step command ('g' and 'y' keys) for
libass-rendered subtitles. It could be fixed, but it's so useless -
especially as with the existing implementation there's no practical
way to get subtitle delay back to normal after using it - that I
didn't bother.

Conflicts:
	command.c
	mp_core.h
	mplayer.c
2012-09-18 21:04:46 +02:00
wm4 5f57d27656 image_writer: add option parsing
image_writer now provides its own option parsing, and screenshot.c and
the mplayer frontend use it.
2012-08-06 17:48:30 +02:00
wm4 d5315a678e mplayer: expand --title as property, remove --use-filename-title
The --title option, which sets the GUI window caption, is now expanded
as slave mode property string (like osd_show_property_text). Make the
default value for --title include the filename. This makes a behavior
similar to --use-filename-title the default.

Remove the --use-filename-title option, as it's redundant now.
2012-08-02 02:37:00 +02:00
wm4 caeff2b1be mixer: make softvol default, and raise softvol-max to 200
mplayer is not a mixer control panel.
2012-07-30 01:46:04 +02:00
wm4 51e198c2a1 Merge remote-tracking branch 'origin/master'
Conflicts:
	.gitignore
	bstr.c
	cfg-mplayer.h
	defaultopts.c
	libvo/video_out.c

The conflict in bstr.c is due to uau adding a bstr_getline function in
commit 2ba8b91a97. This function already existed in this branch.
While uau's function is obviously derived from mine, it's incompatible.
His function preserves line breaks, while mine strips them. Add a
bstr_strip_linebreaks function, fix all other uses of bstr_getline, and
pick uau's implementation.

In .gitignore, change vo_gl3_shaders.h to use an absolute path
additional to resolving the merge conflict.
2012-07-28 17:24:05 +02:00
Uoti Urpala dc2a4863af options: support parsing values into substructs
Add an alternate mode for option parser objects (struct m_config)
which is not inherently tied to any particular instance of an option
value struct. Instead, this type or parsers can be used to initialize
defaults in or parse values into a struct given as a parameter. They
do not have the save slot functionality used for main player
configuration. The new functionality will be used to replace the
separate subopt_helper.c parsing code that is currently used to parse
per-object suboptions in VOs etc.

Previously, option default values were handled by initializing them in
external code before creating a parser. This initialization was done
with constants even for dynamically-allocated types like strings.
Because trying to free a pointer to a constant would cause a crash
when trying to replace the default with another value, parser
initialization code then replaced all the original defaults with
dynamically-allocated copies. This replace-with-copy behavior is no
longer supported for new-style options; instead the option definition
itself may contain a default value (new OPTDEF macros), and the new
function m_config_initialize() is used to set all options to their
default values. Convert the existing initialized dynamically allocated
options in main config (the string options --dumpfile, --term-osd-esc,
--input=conf) to use this. Other non-dynamic ones could be later
converted to use this style of initialization too.

There's currently no public call to free all dynamically allocated
options in a given option struct because I intend to use talloc
functionality for that (make them children of the struct and free with
it).
2012-07-16 21:08:42 +03:00
wm4 1aa2e36122 Merge remote-tracking branch 'origin/master'
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
2012-04-01 22:52:33 +02:00
Stefano Pigozzi 495dde4018 options, x11+cocoa: add option --cursor-autohide-delay
Add option --cursor-autohide-delay to control the number of milliseconds
with no user interaction before the mouse cursor is hidden.

There are two negative values with useful special meanings:
* A value of -1 prevents the cursor from hiding (useful for users
  with multiple displays).
* A value of -2 prevents the cursor from showing upon activity.

The default is 1 second to keep the behaviour consistent with the
past X11 backend implementation.

Remove the vo_mouse_autohide field as it was always true.
2012-03-25 22:30:37 +03:00
Uoti Urpala ec58e5a384 options: move mixer.h options to struct 2012-03-20 14:51:32 +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
Uoti Urpala db8cdc73e3 Update Libav API uses
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.
2012-02-01 22:46:27 +02: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
Uoti Urpala 33cac12954 options: change --ass-hinting default to 0
With current typical video sizes, font sizes are large enough that
they don't really need hinting (and particularly so for font sizes in
display-resolution rendered subtitles in fullscreen mode), and hinting
apparently causes problems with some fonts.
2011-12-07 00:25:38 +02: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 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 4587f030cc options: move sub_name, sub_auto and vobsub_name to struct 2011-04-20 04:22:52 +03: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
Uoti Urpala ebd2058d03 subtitles: options: enable -ass by default
There are still some problems with -ass. For example some other
subtitle options won't work the same way or at all with it enabled,
and inserting the video filter for VOs that lack native rendering
support won't work with different colorspaces. However I think that
the benefit from styling support outweights those disadvantages, and
also that the "discoverability" of features is better this way; it
will be easier for people who encounter problems to find -noass than
for people who see no styling to find out that they could add it with
-ass.

Enable -ass by default. Also fix other outdated information in the
manpage entries for -ass and -fontconfig.
2011-01-26 20:39:05 +02:00
Uoti Urpala 8612c771fc cleanup: some random minor code simplification and cleanup 2011-01-26 13:04:17 +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 2bc2399797 vd_ffmpeg: set thread count to number of cores on machine by default
Make "-lavdopts threads=0" mean an autodetected number of threads, and
make that the default value of the option. Also increase the upper
limit of the option from 8 to 16. Add new file osdep/numcores.c which
tries to determine the number of cores available on the machine.

numcores.c is based (heavily modified) on public domain numcpus.c by
Philip Willoughby <pgw99@doc.ic.ac.uk>, downloaded from
http://csgsoft.doc.ic.ac.uk/numcpus/
2010-12-20 05:53:28 +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
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 e7d3e63a3f options: move -cache-min and cache-seek-min to option struct 2010-11-11 17:53:44 +02:00
Clément Bœsch 6526bee39b options: move some demux options to option struct
Following options were moved: audiofile, audiofile-cache, subfile,
demuxer, audio-demuxer, sub-demuxer, [no]extbased.
2010-11-11 16:31:46 +02:00
Uoti Urpala 2be10f22b2 options: move -dumpfile to option struct 2010-11-02 04:18:38 +02:00
Uoti Urpala 4de0369e8d options: move audio_output_channels, audio_output_format to struct 2010-11-02 04:18:07 +02:00
Uoti Urpala a1f9878c3d options: fix -a52drc default value (should be 1)
Commit 3f076c0fb3 ("options: move -a52drc to option struct") from
yesterday left out setting the default value of the option,
effectively changing the default from 1 to 0. Add the missing part to
change it back to 1.
2010-06-03 15:43:42 +03:00
Uoti Urpala a2133d7684 options: move -chapter values to option struct
-chapter can optionally take a range with a start and an end. Add a
new option type which supports such values and use that instead of a
custom per-option function.

This commit also fixes a build configuration bug: before the
availability of the -chapter option depended on DVD functionality
being enabled in the binary, even though the option works with other
sources too.
2010-04-25 22:48:10 +03:00
Daniel Dawson c3c0309eec Support for multiple editions in Matroska
Add code to intelligently choose an appropriate Matroska edition when
there are several. Will choose, in descending order of preference: the
edition chosen by the user through the option "-edition <edition id>"
if it exists, the first edition with EditionFlagDefault set to 1 if
there is one, or the first edition.
2009-12-04 19:43:17 +02:00
Uoti Urpala 7fd3eb0f74 Merge svn changes up to r29752
As part of merging subtitle-in-terminal changes make
update_subtitles() only clear existing subtitles if called with the
reset argument, and not try to set new ones. Later calls should set
the needed new subtitles, and this change avoids some problems with
trying to set subtitles when mp_property_sub() in command.c gets
called from initialization code before full initialization.
2009-10-06 04:48:00 +03:00
Uoti Urpala d9066294f9 defaultopts.c: Minor simplification
This happens to avoid a compiler bug in the current GCC development
branch.
2009-04-09 04:19:40 +03:00
Uoti Urpala 53eeb0e412 Merge branch 'ordered_chapters' 2009-04-08 02:43:44 +03:00
Uoti Urpala 96daf7ed5e Add option -noordered-chapters. 2009-04-08 02:42:19 +03:00
Uoti Urpala 861d6d2bd9 Make -fixed-vo the default
Lack of -fixed-vo causes the output window to be recreated not only
when changing files but also when switching the video stream, and that
happens when moving from one ordered chapter source to another. Having
the window disappear and reappear (likely at another location if it
was ever moved) is just too annoying.
2009-04-02 06:51:26 +03:00
Uoti Urpala cf9edda1d3 Merge svn changes up to r29117 2009-04-01 02:43:47 +03:00
Uoti Urpala 694c067e19 options: Move osd_level and osd_duration to options struct 2009-03-31 18:24:10 +03:00
Uoti Urpala ae2faad666 Merge svn changes up to r28951 2009-03-14 23:52:45 +02:00
Uoti Urpala 41ac08d2b4 options: fix -ar default back to enabled if available
Due to a missed config variable rename -noar was always the default.
Make it default to enabled if available as it was before.
2009-02-16 23:16:11 +02:00
Uoti Urpala d5c868325c Merge svn changes up to r26979
Most of the conflicts are trivial.

Conflicts:

	Makefile
	cfg-mplayer.h
	input/input.c
	libmenu/vf_menu.c
	libmpcodecs/dec_video.c
	libmpcodecs/vf_expand.c
	libmpcodecs/vf_vo.c
	libmpdemux/demux_mkv.c
	libmpdemux/demuxer.c
	libmpdemux/demuxer.h
	libvo/vo_directfb2.c
	libvo/vo_gl.c
	libvo/vo_winvidix.c
	libvo/vo_xv.c
	libvo/vo_xvidix.c
	libvo/vo_xvmc.c
	libvo/x11_common.c
	mplayer.c
	osdep/timer-linux.c
	stream/cache2.c
2008-06-04 08:10:48 +03:00
Uoti Urpala 1d1ddcb593 Move aspect.c options to option struct 2008-05-01 11:14:29 +03:00
Uoti Urpala 8de8be1536 Move input options to option struct 2008-04-30 19:34:48 +03:00