Commit Graph

36106 Commits

Author SHA1 Message Date
Martin Herkt d4bdcdfe09 .gitignore: add pdflatex output files 2013-09-23 19:07:22 +02:00
Martin Herkt 8764f4cf96 sub/ass_mp: remove superfluous message prefixes 2013-09-23 19:02:23 +02:00
Martin Herkt 3807038193 install: don’t force append /mpv to docdir 2013-09-23 14:09:15 +02:00
wm4 ee57f7fdae win32: edit resource files, in particular set CompanyName
Setting CompanyName (probably) helps with issue #256.

Update some other fields as well, because why not. (They're full of
MPlayer remnants.)
2013-09-23 01:44:09 +02:00
wm4 ddca41bd54 demux: don't print "Clip info:" line if there are no tags 2013-09-23 01:22:48 +02:00
Paul B Mahol 20b2d7cb6f ao_oss: add support for SNDCTL_DSP_RESET and use it when pausing
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: wm4 <wm4@nowhere>
2013-09-23 01:21:37 +02:00
wm4 cc7f8ee620 mplayer: attempt to make playback resume work with DVD/BD
The problem with DVD/BD and playback resume is that most often, the
filename is just "dvd://", while the actual path to the DVD disk image
is given with --dvd-device. But playback resume works on the filename
only.

Add a pretty bad hack that includes the path to the disk image if the
filename starts with dvd://, and the same for BD respectively. (It's a
bad hack, but I want to go to bed, so here we go. I might revert or
improve it later, depending on user feedback.)

We have to cleanup the global variable mess around the dvd_device.
Ideally, this should go into MPOpts, but it isn't yet. Make the code
paths in mplayer.c take MPOpts anyway.
2013-09-22 03:31:25 +02:00
wm4 b0f7a26f1a network: fix rtsp playback
By default, libavformat uses UDP for rtsp playback. This doesn't work
very well. Apparently the reason is that the buffer sizes libavformat
chooses for UDP are way too small, and switching to TCP gets rid of this
issue entirely (thanks go to Reimar Döffinger for figuring this out).

In theory, you can set buffer sizes as libavformat options, but that
doesn't seem to help.

Add an option to select the rtsp transport, and make TCP the default.

Also remove an outdated comment from stream.c.
2013-09-22 02:40:29 +02:00
wm4 ce861c9f33 stream_lavf: print lavf options that could not be set
Mainly for debugging. Usually, we just set options for all possible
protocols, and we can't really know whether a certain protocol is used
beforehand. That's also the reason why avio_open2() takes a dictionary,
instead of letting the user set options directly with av_opt_set(). Or
in other words, we don't know whether an option that could be set is an
error or not, thus we print the messages only at verbose level.
2013-09-22 02:20:18 +02:00
wm4 eda596a3f9 command: when changing volume while muted, show an extra message on OSD
So nobody has to wonder why everything is silent, even if they raise the
volume.
2013-09-21 00:08:38 +02:00
wm4 897d4b58a1 command: when changing a property, allow showing an extra OSD message
This is for properties that normally show a bar, and thus do not show an
OSD message (as per classic mplayer behavior). Setting an extra_msg
allows showing an OSD message anyway, except if OSD messages are
explicitly suppressed.

This refactors the whole show_property_osd() function a bit, and
replaces the weird sep field with a more general method.
2013-09-21 00:07:42 +02:00
wm4 f988c63003 m_property: add a way to switch on property values in property expansion
Allows for example: --status-msg='${?pause==yes:(Paused) } ...' to
emulate the normal terminal status line. It's useful in other situations
too.

I'm a bit worried about extending this mini-DSL, and sure hope nobody
will implement a generic formula evaluator at some point in the future.
But for now we're probably safe.
2013-09-20 23:09:43 +02:00
wm4 ab706f9969 m_property: rearrange code 2013-09-20 22:26:08 +02:00
wm4 99576ac483 command: don't append, but prepend deinterlace filter by default
In most cases, it's better if deinterlacing happens before any other
filtering, so prepend the filter to the user's filter list, instead
of appending it.
2013-09-20 16:48:08 +02:00
wm4 d5a3739105 vo_lavc: mp_msg conversion
Also restores consistent log message prefixes with ao_lavc.
2013-09-20 16:32:36 +02:00
wm4 0611c43b97 command: use a list of potential deinterlacer filters
Instead of hardcoding a single filter. This might be helpful for
modeling the vaapi deinterlacer as a video filter. The idea is that a
software deinterlacer would be tried first, and if that fails (because
vaapi hardware decoding uses HW surfaces, which a software deinterlacer
does not accept), the vaapi filter would be tried.
2013-09-20 15:09:29 +02:00
wm4 2694b5f378 vo/x11_common: don't require a working input method
Normally, we need this for Xutf8LookupString(). But we can just fall
back to XLookupString(). In fact, the code for this was already there,
the code was just never tested and was actually crashing when active
(see commit 2115c4a).
2013-09-20 14:45:49 +02:00
wm4 6c28524e0f vf: fix filter initialization error check
vf_open returns 0 on error, 1 on success. Oops. Accidentally broken
with 6629a95.
2013-09-20 14:01:00 +02:00
Johan Kiviniemi 912f609403 ao_pulse: bug fix: goto the correct error handler 2013-09-20 13:50:45 +02:00
Johan Kiviniemi e5710ccc5d ao_pulse: set the property media.role=video 2013-09-20 13:50:13 +02:00
wm4 3e5b632559 Merge branch 'volume_restore' 2013-09-20 13:48:36 +02:00
wm4 542086dd45 af: merge af_reinit() and fix_output_format()
Calling them separately doesn't really make sense, and all existing
calls to them usually combined them. One subtitle difference was that
af_init() didn't wipe the filter chain if initialization of the chain
itself failed, but that didn't really make sense anyway.

Also remove af_init() from the code for setting balance in mixer.c. The
mixer should be in the initialized state only if audio is fully
initialized, so the af_init() call made no sense.

Note that the filter "editing" code in command.c doesn't really do a
nice job of handling errors in case recreating an _old_ (known to work)
filter chain unexpectedly fails, and this obscure/rare case might be
differently handled after this change.
2013-09-20 13:43:00 +02:00
wm4 0162271725 mixer: make struct opaque
Also remove stray include statements from ao_alsa and ao_oss.
2013-09-20 13:23:25 +02:00
wm4 327a779a81 mixer: allow accessing volume and mute property on disabled audio
The volume is set as soon as the audio chain is created again. This
works only in softvol mode. For system wide volume or otherwise
externally user controllable volume, this code is intentionally
disabled. It would be extremely weird if changing volume (while audio is
not initialized) would do nothing, and then suddenly change it when the
audio chain is created.

There's another odd corner case: the user-set volume will be thrown away
if it's set before the _first_ audio chain initialization. This is
because the volume restore logic recognizes a change from nothing to
softvol or an AO, and circumventing that would require additional code.
Also, we don't even know the start volume before that point.

Forcing the volume with --volume will can override the volume set during
no-audio mode, depending on the situation.
2013-09-20 13:23:25 +02:00
wm4 7623c94ddc manpage: af_volnorm was renamed 2013-09-20 13:23:25 +02:00
wm4 b8e42ae13c mixer: restore volume with playback resume
Note that this is intentionally never done if the AO or softvolume is
different, or if the current volume control method is thought to control
system wide volume (such as ALSA) or otherwise user controllable (such
as PulseAudio). The intention is to keep things robust and to avoid
messing with the user's audio settings as far as possible, while still
providing the ability to resume volume if it makes sense.
2013-09-20 13:23:25 +02:00
Martin Herkt ed2d67b6d7 vo/x11_common: remove superfluous msg prefixes 2013-09-20 00:04:39 +02:00
Stefano Pigozzi 061b6ab3aa macosx_application: fix regression causing crash
95a2151d1 introduced a crash on systems lower than 10.9 when opening files
with a single argument.
2013-09-19 22:03:49 +02:00
Stefano Pigozzi 00d8e85373 Revert "osxbundle: fonts.conf: only look for fonts in ~/.mpv/fonts"
Commit broke text subtitles without embedded fonts. Will look for a better
solution later. Revert it for now, since I'm starting to get bug reports.

This reverts commit 4a9f618d9f.
2013-09-19 21:39:16 +02:00
Martin Herkt 2115c4a3ad vo/x11_common: Fail init with no valid XIM
XOpenIM can fail to find a valid input method, in which case it
returns NULL. Passing a NULL pointer to XCreateIC would cause a
crash, so fail VO init before that happens.
2013-09-19 20:08:34 +02:00
Alexander Preisinger 858dcee5f1 wayland/common: exit properly on fd errors
Before this commit there was just an error message, but the file descriptor was
still open. Now we close the file descriptor and prevent it from calling
endlessly. Also a CLOSE_WIN event is sent which closes the window eventually if
the action of CLOSE_WIN is set to quit or quit_watch_later.
2013-09-19 17:45:49 +02:00
wm4 6599677b98 mplayer: rename a somewhat misnamed function 2013-09-19 17:28:27 +02:00
wm4 93feffad15 vo_opengl: blend alpha components by default
Improves display of images and video with alpha channel, especially if
the transparent regions contain (supposed to be invisible) garbage
color values.
2013-09-19 17:03:03 +02:00
wm4 234d967bed mixer: don't unmute audio when raising volume
This is rather strange behavior, away with it.
2013-09-19 14:32:25 +02:00
wm4 38b2c97fd6 mixer: refactor, fix some aspects of --volume handling
Refactor how mixer.c does volume/mute restoration and initialization.
Move to handling of --volume and --mute to mixer.c. Simplify the
implementation of these and hopefully fix bugs/strange behavior related
to using them as file-local options (this uses a somewhat dirty trick:
the option values are reverted to "auto" after initialization). Put most
code related to initialization and volume restoring in probe_softvol()
and restore_volume(). Having this code all in one place is less
confusing.

Instead of trying to detect whether to use softvol at runtime, detect it
at initialization time using AOCONTROL_GET_VOLUME (same with mute,
AOCONTROL_GET_MUTE). This implies we expect SET_VOLUME/SET_MUTE to work
if the GET variants work. Hopefully this is always the case.

This is also preparation for being able to change volume/mute settings
if audio is disabled, and for allowing restoring value with playback
resume.
2013-09-19 14:32:09 +02:00
wm4 4ba52a9e82 mixer, af_volume: use linear values instead of dB
Softvol always used a linear multiplier for volume control. This was
converted to dB, and then back to linear in af_volume. Remove this non-
sense. We still try to keep the command line argument to af_volume in
dB, though.
2013-09-19 14:31:55 +02:00
wm4 296531ad00 mixer: minor refactoring
Let struct mixer access access MPOpts to simplify some things. Rename
some variables and functions. There should be no functional changes.
2013-09-19 14:31:43 +02:00
wm4 69e272dad7 af_export: fix compilation warning
Blargh.
2013-09-19 14:30:53 +02:00
Stefano Pigozzi 4a9f618d9f osxbundle: fonts.conf: only look for fonts in ~/.mpv/fonts
This is to avoid the 30s hang while mpv caches fonts. In practice all the
fonts an average user is going to use are embedded in mkv files so there is
no reason to build fontconfig's cache on all of OS X system directories.

I might add something similar for terminal usage, but I am highly undecided.
2013-09-18 22:18:33 +02:00
wm4 5249cccfcf Config path functions can return NULL
It's quite unlikely, but functions like mp_find_user_config_file() can
return NULL, e.g. if $HOME is unset.

Fix all the code that didn't check for this correctly yet.
2013-09-18 19:56:15 +02:00
wm4 1298dbdf01 osdep/path: remove ifdefs
They're not really needed, so kill them.
2013-09-18 19:42:19 +02:00
Stefano Pigozzi af018f7e4f macosx: move bundle path stuff to path-macosx.m
This makes the code uniform to how stuff was handled for Windows in 1cb55ceb.
2013-09-18 19:30:11 +02:00
wm4 1cb55cebf9 path, win32: redo user configfile path handling
Remove the ifdef hell from mp_find_user_config_file(). Move the win32
specific code (for MinGW and Cygwin) to path-win.c. The behavior should
be about the same, but I can't be sure due to lack of testing and
because the old path.c code was hard to follow. (I expect those who care
about windows will fix things, should issues pop up - sorry.)

One difference is that the new code will always force MPV_HOME. It looks
like the old code preferred the mpv config dir in the exe dir if it
exists.

Also, make sure MP_PATH_MAX has enough space, even if the equivalent
wchar_t string is not 0-terminated with PATH_MAX (because apparently the
winapi doesn't require this). (Actually, maybe we should just kill all
uses of PATH_MAX/MP_PATH_MAX.)
2013-09-18 19:08:51 +02:00
wm4 12372298a2 win32: add getenv() UTF-8 variant
This is a bit "hard", because getenv() returns a static string, and we
can't just return an allocated string. We also want getenv() to be
thread-safe if possible. (If the mpv core is going to be more threaded,
we sure do want the lower layers to be thread-safe as well.)
2013-09-18 19:08:51 +02:00
wm4 b97d10a839 path: fix undefined behavior
The homepath variable was static, and its value was set to a stack
buffer. This means a second invocation of the function would trigger
undefined behavior. Moreover the stack buffer always went out of scope
before homepath was used.
2013-09-18 19:08:51 +02:00
Stefano Pigozzi bb4ea8bb3e cocoa_common: signal a mouse movement when changing window size
This is mainly to avoid spurious cursor states due to the mouse moving inside
or outside the window as a result of the window resize (with cmd-0/1/2).

This avoids complex logic and triggers a mouse move so that the player
recomputes the correct cursor state based on the autohide configuration of
the user.
2013-09-18 19:05:00 +02:00
Stefano Pigozzi a08802016d cocoa_common: override core's cursor visibility state
This keeps the state in sync with the current state in cocoa_common. Infact the
cocoa code in mpv can decide wether it really wants to hide the cursor based on
the result of the `canHideCursor` method (this is so that the cursor is only
hidden when hovering on the video window).
2013-09-18 19:05:00 +02:00
Stefano Pigozzi fc74574df0 HIDRemote: remove OS X version checks
Turns out that these checks were for versions of OS X that mpv doesn't even
support anymore. So just remove the checks since they cause a deprecation
warning.
2013-09-17 20:44:54 +02:00
wm4 82de39b7d5 find_subfiles: fix really dumb bug causing segfaults
NULL pointer deref when a .sub file with the same filename as the video
file was present.

I was probably half asleep when writing this code.
2013-09-17 15:41:23 +02:00
Nyx0uf 95a2151d19 macosx_application: remove deprecation warning on OS X 10.9
GetCurrentProcess() is deprecated on 10.9. Make a universal solution by
checking OS version number.

get_system_version() function is the recommended Apple way of getting the
OS version, since Gestalt is also deprecated (and does pretty much the same
thing anyway)

Updating HIDRemote.m to use a similar function would allow to get rid of the
2 other warnings.
2013-09-16 21:51:08 +02:00