Commit Graph

1913 Commits

Author SHA1 Message Date
wm4 afead7a356 audio: merge --replaygain-track and --replaygain-album into one option
This is probably better than separate options. For example, the user
does not have to guess which one is applied if both options are enabled.
2017-04-27 00:21:17 +02:00
wm4 90a1ca02a2 audio: fix replaygain volume scale
The new replaygain code accidentally applied the linear gain as cubic
volume level. Fix this by moving the computation of the volume scale out
of the af_volume filter.

(Still haven't verified whether the replaygain code works correctly.)
2017-04-27 00:15:32 +02:00
wm4 f1c4d20e65 audio: move replaygain control to top-level options
af_volume is deprecated, and so are its replaygain sub-options. To make
it possible to use replaygain without deprecated options (and of course
to make it available at all after af_volume is dropped), reintroduce
them as top-level options.

This also means that they are easily changeable at runtime by using them
as properties. Change the "volume" property to use the new update
mechanism as well.

We don't actually bother sharing the implementation between new and
deprecated mechanisms, as the deprecated one will simply be deleted.

For the from_dB() functions, we mention anders' copyright, although I'm
not sure if a mere formula is copyrightable. This will have to be
determined later.

This whole change is mostly untested. Our distributed human CI will take
care of it.
2017-04-26 21:45:55 +02:00
Marko Hauptvogel 3fe6b36eb0 player: close audio device on no audio track
Close the audio device if there is no audio track (or stream) in the
current file. It will be opened again if the next file should contain
audio.

Signed-off-by: Marko Hauptvogel <marko.hauptvogel@googlemail.com>
Signed-off-by: wm4 <wm4@nowhere>
2017-04-25 20:21:09 +02:00
Ricardo Constantino 18703b55d8
osc: also add processing for axis_up/down events
Considered semantically equivalent with mouse_btn3/4.

This is a preemptive fix for upcoming changes to AXIS_* events.
2017-04-25 15:42:09 +01:00
Ricardo Constantino 3526b95aaf
ytdl_hook: treat single-entry playlists as a single video 2017-04-23 01:53:59 +01:00
Ricardo Constantino d5517f0d9f
ytdl_hook: move single video code to a separate function 2017-04-23 01:53:57 +01:00
wm4 a5f54209c0 external_files.c: add GPL header
It's been missing since mplayer2 times, not sure why. It originates from
subreader.c. No analysis on whether it can be relicensed to LGPL was
done yet.
2017-04-21 13:33:51 +02:00
Avi Halachmi (:avih) 150c988e88
osc: add user_opts.boxmaxchars for box layout title limit
The default of 80 is conservative to allow relatively wide fonts, but
with many common fonts a bigger number can be used without overflow.
2017-04-19 20:35:58 +01:00
Ricardo Constantino 05c8707a0b
osc: add volume icons to osd font and use them
Glyphs taken and based on U+1F507 to U+1F50A from Symbola, which
is available under public domain: http://users.teilar.gr/~g1951d/
2017-04-19 20:18:23 +01:00
Ricardo Constantino 9d6c208afa
osc: move volume left of fullscreen button 2017-04-19 20:18:23 +01:00
Ricardo Constantino fe937e866d
osc: bottom/topbar: add fullscreen button 2017-04-19 20:18:23 +01:00
Ricardo Constantino a477c864a4
osc: add volume button
Click to toggle mute, mouse wheel to change volume.
OSD is shown on volume change.
2017-04-19 20:18:23 +01:00
Ricardo Constantino 00ab5a15be
osc: support handling mouse wheel events 2017-04-19 20:18:23 +01:00
Ricardo Constantino e870b7ad66
osc: simplify checks in key handler
Use a helper function for these safety checks.
2017-04-19 20:18:23 +01:00
Ricardo Constantino 82bf4567f9
osc: fix last potential race condition on key events 2017-04-19 20:18:15 +01:00
wm4 bbfafb5614 Fix use of ISC license
The license text refers a "above copyright notice", so I guess it'd be
good to actually provide such a notice.

Add the license to some files that were missing it (since in theory, our
Copyright file says that such files are LGPL by default).

Remove the questionable remarks about the license in the client API.
2017-04-15 16:20:00 +02:00
wm4 3e8510d515 player: fix a corner case in previous commit
The previous commit set "mpctx->playback_active = false;" before unload
hooks were processed. This was intentional, but could in theory cause
playback_active to be set to true again, and actually it's plain wrong
if playback was exited in the middle it. There needs to be something
else that forces playback_active to be set to false while in this
unloading state.
2017-04-14 19:06:31 +02:00
wm4 b586bc2dbe player: fix core-idle and eof-reached update notifcations
Make mpv_observe_property() work correctly on them even with
--keep-open-pause=no.

This also changes the situations in which the screensaver is
enabled/disabled subtly.
2017-04-14 18:58:48 +02:00
wm4 419624fb06 player: unmess pause state handling
Merge the pause_player() and unpause_player() functions. Make sure the
pause events are emitted properly. We can now set the internal pause
state based on a predicate, instead of e.g. handle_pause_on_low_cache()
making a mess to trigger the internal pause state as wanted.

Preparation for some more changes.
2017-04-14 18:22:45 +02:00
Dan Oscarsson ae0a40259f player: add --keep-open-pause=no option
Instead of pausing if --keep-open is active, stop
at end but continue playing if seeking backwards.
And then stop again when end is reached.

Signed-off-by: wm4 <wm4@nowhere>

Over the PR, the option was renamed, and the manpage additions were
slightly changed/enhanced.
2017-04-14 17:43:34 +02:00
wm4 4c516a064a osc: use "loop-playlist" instead of "loop" property 2017-04-11 12:44:41 +02:00
wm4 e2464b832b command, manpage: some leftover mentions of renamed --loop option 2017-04-11 12:15:38 +02:00
wm4 844008004f command: update sub-fps etc. options on runtime changes
Un-special-case the sub-speed property, and apply subtitle speed updates
in more cases. In particular, this respects runtime changes of the
sub-fps option.

(A minor consequence of this is that the subtitle speed is recomputed
more often even in cases when it's not necessary. Also, the subtitle
update is slightly "delayed" rather than strictly instant. Both of
these likely are absolutely not observable by the user, although the
subtitle speed verbose log message will be printed more often if the
subtitle format is MicroDVD.)
2017-04-10 21:22:26 +02:00
wm4 b96a74ec2a audio: deprecate most audio filters
Well, ok, only 4 filters. The rest will survive in one or the other
form.
2017-04-04 15:04:07 +02:00
wm4 3a9e661e92 video: deprecate almost all video filters
The plan is to nuke the custom filter chain completely. It's not clear
what will happen to the still needed builtin filters (mostly hardware
deinterlacing and vf_vapoursynth). Most likely we'll replace them with
different filter chain concept (whose main purpose will be providing
builtin things and bridging to libavfilter).

The undocumented "warn" options are there to disable deprecation
warnings when the player inserts filter automatically.

The same will be done to audio filters, at a later point.
2017-04-02 18:00:16 +02:00
wm4 7ddacd6390 screenshot: cleanup: use normal MSGL_ defines
Remove the weird custom thing.
2017-04-01 20:47:36 +02:00
wm4 9bcb9fcf26 player: make screenshot commands honor the async flag
And also change input.conf to make all screenshots async. (Except the
every-frame mode, which always uses synchronous mode and ignores the
flag.) By default, the "screenshot" command is still asynchronous,
because scripts etc. might depend on this behavior.

This is only partially async. The code for determining the filename is
still always run synchronously. Only encoding the screenshot and writing
it to disk is asynchronous. We explicitly document the exact behavior as
undefined, so it can be changed any time.

Some of this is a bit messy, because I wanted to avoid duplicating the
message display code between sync and async mode. In async mode, this is
called from a worker thread, which is not safe because showing a message
accesses the thread-unsafe OSD code. So the core has to be locked during
this, which implies accessing the core and all that. So the code has
weird locking calls, and we need to do core destruction in a more
"controlled" manner (thus the outstanding_async field).

(What I'd really want would be the OSD simply showing log messages
instead.)

This is pretty untested, so expect bugs.

Fixes #4250.
2017-04-01 20:47:23 +02:00
wm4 7bab24b9b3 player: enable "buffering" pausing for DASH streams too
This wasn't enabled if no stream cache was used. It can work with only
the demuxer cache.

In theory this could be always enabled (even for local files), but still
try to avoid this, and enable it only if the source is marked as
potentially being a "network" stream. The intention is mostly to enable
it for the youtube-dl pseudo-DASH support.
2017-04-01 16:47:15 +02:00
Ricardo Constantino d2fcca7ad0
external_files: enable autoloading with URLs
Closes #3264
2017-04-01 15:42:42 +01:00
Ricardo Constantino 5f0c7df598
external_files: actually try to autoload from fallback paths
The 'sub' and 'audio' configuration subdirectories are supposed to
be fallbacks for sub-paths and audio-file-paths respectively, but
they weren't being scanned even if they existed.
2017-04-01 15:42:39 +01:00
wm4 9b077a5cca command: add property notifications for hwdec properties
This is a bit approximate, because we rely on the pixel format changing
if the hardware decoding changes. This is not always true, as the pixel
format for software decoded video and hardware decoded video copied back
to CPU RAM could be the same. (Not sure if that is actually the case for
any supported cases.)

But for now this should fix most of #4289.
2017-03-31 17:28:15 +02:00
Ricardo Constantino 07ee7fb2c3
osc: escape ASS and strip newlines on title 2017-03-27 18:00:56 +01:00
Ricardo Constantino dc00ad537f
osc: make title configurable and use property expansion on it 2017-03-27 18:00:56 +01:00
Ricardo Constantino ebf61267f4
Revert "osc: make the title toggleable between media-title and filename"
This reverts commit 6573b73462.
2017-03-27 18:00:54 +01:00
Akemi f8a223b7ac osx: initial Touch Bar support 2017-03-26 20:26:18 +02:00
Avi Halachmi (:avih) afbd657bb8 command: add expand-text command to property-expand a string 2017-03-26 19:58:51 +02:00
Ricardo Constantino 6573b73462
osc: make the title toggleable between media-title and filename
Close #4221
2017-03-26 14:41:03 +01:00
wm4 3eb6607e5e player: make new stream output more consistent with other output
It seems we generally skip the space, such as seen on the AO init line.
2017-03-26 14:13:36 +02:00
Dan Oscarsson 823f2c603d player: print additional stream info
In print_stream print additional stream info for audio
and video track. While it may be incorrect it is mostly
correct and good info to have.
2017-03-26 14:12:39 +02:00
wm4 7d424b4ce4 command: add better runtime filter toggling method
Basically, see the example in input.rst.

This is better than the "old" vf-toggle method, because it doesn't
require the user to duplicate the filter string in mpv.conf and
input.conf.

Some aspects of this changes are untested, so enjoy your alpha testing.
2017-03-25 17:07:40 +01:00
Matthias Hunstock 3e93c09cff command: add demux-start-time property
Add a demux_start_time property, update docs.
2017-03-25 14:44:11 +01:00
Ricardo Constantino aae0833fc6
osc: fix PlayResX undefined warning when aspect is 0 2017-03-24 16:23:39 +00:00
Ricardo Constantino bc8710a98d
osc: bottom/topbar: don't clip title vertically 2017-03-24 16:16:12 +00:00
Ricardo Constantino aee08e3f51
osc: bottom/topbar: increase timecodes width a bit
Compensates for wider fonts like DejaVu Sans Mono.
Further compensate for the minus sign in the right timecode by 10px.

Closes #3952
2017-03-24 16:16:11 +00:00
Ricardo Constantino 03b2710dc8
osc: refactor cache status display
This removes the twitch of the right-aligned cache status.
2017-03-24 16:16:10 +00:00
Ricardo Constantino bcb2db078c
osc: refactor osc message scaling
Will still hide playlist items with long enough filenames and osd-font-size
but not as soon.

osc messages should now preserve their scaling with fullscreen toggling and
cycling through audio-only files and files with video.

Closes #4081, #4083, #4102
2017-03-24 16:16:07 +00:00
wm4 b9e4fb952d command: add a property to signal whether networking is used
Requested. The property semantics are a bit muddy due to lack of effort.
Anticipated use is different display of cache status, so it should not
matter anyway.
2017-03-24 15:31:01 +01:00
wm4 46e3dc27af screenshot: change details of --screenshot-format handling
This is just a pointless refactor with the only goal of making
image_writer_opts.format a number.

The pointless part of it is that instead of using some sort of arbitrary
ID (in place of a file extension string), we use a AV_CODEC_ID_. There
was also some idea of falling back to the libavcodec MJPEG encoder if
mpv was not linked against libjpeg, but this fails. libavcodec insist on
having AV_PIX_FMT_YUVJ420P, which we pretend does not exist, and which
we always map to AV_PIX_FMT_YUV420P (without the J indicating full
range), so encoder init fails. This is pretty dumb, but whatever. The
not-caring factor is raised by the fact that we don't know that we
should convert to full range, because encoders have no proper way to
signal this. (Be reminded that AV_PIX_FMT_YUVJ420P is deprecated.)
2017-03-18 15:03:05 +01:00
wm4 d26788fbd7 screenshot: minor simplification
This also will set image=NULL, if the video frame is marked as hwaccel,
and could not be copied to normal RAM. This will probably change the
error message (due to screenshot_get() returning NULL, instead of making
image conversion fail at a later point), but the behavior is the same
anyway.
2017-03-18 14:15:34 +01:00