0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00
Commit Graph

1029 Commits

Author SHA1 Message Date
wm4
4c1b45b5ab command: don't drop audio buffers when switching filters
This partially reverts commit ae7228c6. I guess the old behavior was
slightly more popular.

Fixes #1693 (probably).

(cherry picked from commit 699fc0e51e)
2015-03-17 10:49:56 +09:00
wm4
62d922e4f0 command: allow changing some VO options even if VO wasn't created yet
Instead of refusing to set properties like "fullscreen" if no VO was
created, always allow it. So if no VO is created, setting the property
merely changes the options (and will be applied once the VO is created).
This is consistent with similar behavior changes to some other
properties.

Improves the behavior reported in #1676.

Also, we shouldn't check the config_ok variable - the VO should do this.

(cherry picked from commit e9841630ad)
2015-03-15 20:07:06 +09:00
wm4
eaa5393c4a player: fix crash when taking screenshots in idle mode
mpctx->filename is obviously not set if no file is playing.

When this code was written, it probably couldn't happen, because the
normal screenshot path fails much earlier in idle mode. But you can
still take screenshots in "full window" mode, and recently the
screenshot code was changed to use the "full window" mode if the normal
path does not work.

(cherry picked from commit ca474d22c9)
2015-03-15 20:06:50 +09:00
torque
80669188d6 Lua: add unpack shim for Lua 5.2/5.3 compatibility.
The global unpack function got moved to table.unpack in Lua 5.2, and
it's only available as the global if 5.2 is built with compatibility
enabled (the default). Lua 5.3 does not build with 5.1 compatibility by
default.

Fixes #1648.

(cherry picked from commit 4ff29f33b0)
2015-03-11 12:33:53 +09:00
wm4
1a3a3aba63 player: allow changing playback speed in early audio init stages
If the audio decoder was created, but no audio filter chain created yet
(still trying to decode a first audio frame), setting the "speed"
property could explode. It tried to recreate the filter chain, even
though no format was set yet.

This is inconvenient and should not happen.

(cherry picked from commit 720d4a5a1a)
2015-03-11 12:33:22 +09:00
wm4
83119f05c4 build: fix warnings with --disable-libass
This crap seems to break every other fullmoon.

(cherry picked from commit 0bbf36b796)
2015-03-05 10:46:49 +09:00
wm4
78349cc188 player: refine rar:// playlist-safety handling
It was possible to make the player play local files by putting rar://
links into remote playlists, and some other potentially unsafe things.

Redo the handling of it. Now the rar-redirector (the thing in
demux_playlist.c) sets disable_safety, which makes the player open any
playlist entries returned. This is fine, because it redirects to the
same file anyway (just with different selection/interpretation of the
contents). On the other hand, rar:// itself is now considered fully
unsafe, which means that it is ignored if found in normal playlists.

(cherry picked from commit a4b6bf8c41)
2015-03-03 16:08:43 +09:00
torque
76fd4b4e33 Lua: add mp.get_screen_margins().
When used with mp.get_screen_size(), mp.get_screen_margins() allows a
Lua script to determine what portion of the mpv window actually has the
video in it.

(cherry picked from commit 1bbf1eb3ce)
2015-03-03 16:06:46 +09:00
wm4
01223a3e0f player: adjust A/V desync message
Broken drivers are an issue rather often. Maybe this gives the user an
idea that this could be the reason. (We can't dump much more info on a
80x24 terminal.)

(cherry picked from commit a5f3083ae7)
2015-03-03 15:58:57 +09:00
Diogo Franco (Kovensky)
423d47130a Fix compilation
Broken by unchecked cherry-picking of 53867aa.
2015-02-25 11:16:18 +09:00
wm4
a5458a624d ytdl: add --no-warnings
Silences "[ytdl_hook] WARNING: video doesn't have subtitles", which was
an annoying and pointless message printed with almost all youtube
videos.

(cherry picked from commit 7cff2e4131)
2015-02-25 11:01:05 +09:00
Jaime Marquínez Ferrándiz
edf0b93703 ytdl: Adapt to new subtitles structure
The requested formats can be sorted by preference and the result gives now an url or the subtitles file content

(cherry picked from commit 7281a72fab)
2015-02-25 11:00:55 +09:00
wm4
352c00fd08 encoding: allow encoding to channel configurations other than stereo
A while ago, we made mpv output the native number of channels by
default, instead of stereo. I assumed this was not wanted for encode
mode.

This commit keeps the assumption, but allows setting the number of audio
output channels at all, instead of always forcing stereo. (Pretty much a
hack.)

(cherry picked from commit 636d6d724d)
2015-02-25 10:51:05 +09:00
wm4
4753a92b80 player: fix demuxer lifetime management
Commit f54220d9 attempted to improve this, but it got worse. Now there
was a crash when ytdl_hook.lua added external tracks. This happened
because close_unused_demuxers() assumed that sources[0] was the main
demuxer (so that it didn't close it). This assumption failed, because
the ytdl script can add external tracks before the main file is loaded.
The easy fix would have been to check for master_demuxer, and not i==0.
But instead give up on the old idea, make some stricter assumptions how
demuxers and external tracks map, and simplify the code.

(cherry picked from commit 53867aa9d8)
2015-02-24 12:16:00 +09:00
wm4
822e6e0dd1 player: move timeline scanning (ordered chapters etc.) to a thread
Do timeline building (scanning & opening reference files for ordered
chapters, and more) in a thread. As a result, this process can actually
be stopped without having to kill the player.

This is pretty simple: just reuse the demuxer opening thread. We have
to give up on the idea that open_demux_reentrant() is reusable, though.

(Althoughthe timeline readers still need some fixes before they react to
the quit request.)

(cherry picked from commit 44411674eb)
2015-02-21 20:49:50 +09:00
wm4
45b63c78cd player: cosmetics: async/non-blocking -> reentrant
These functions do blocking work on a separate thread, but wait until
they return. So they are not async or non-blocking. But they do react to
user-input and client API accesses, which makes them reentrant.

(cherry picked from commit 2c305d5b29)
2015-02-21 20:49:32 +09:00
wm4
3be989dcd0 demux_edl: make independent from MPContext
(cherry picked from commit d7a4cb14ff)
2015-02-19 13:39:38 +09:00
wm4
0adc8ee5c1 demux_edl: move implementation
Same deal as with demux_cue, and a separate commit for the same reasons.

(cherry picked from commit 1e44c811f3)
2015-02-19 13:39:38 +09:00
wm4
55fe8aab6a demux_cue: make independent from MPContext
Also see previous commit(s).

(cherry picked from commit 10781c2a9c)
2015-02-19 13:39:38 +09:00
wm4
b2aa388f27 demux_cue: move implementation
Move the implementation, of which most was in tl_cue.c, to demux_cue.c.
Currently, this is illogical, because tl_cue.c still accesses MPContext.
This is going to change, and then it will be better if everything is in
demux_cue.c. This is only a separate commit to distinguish code movement
and actual work; the next commit will do the actual work.

(cherry picked from commit 7f03f46882)
2015-02-19 13:39:38 +09:00
wm4
8161b47e73 matroska: move timeline code to demux/
Separate from previous commit, because git is bad at tracking file
renames when the file contents are also changed.

(cherry picked from commit edc0007e74)
2015-02-19 13:39:38 +09:00
wm4
f113e03b89 matroska: make timeline code independent of MPContext
(cherry picked from commit 5a186d5942)
2015-02-19 13:39:38 +09:00
wm4
630a7b7d82 player: use a separate context for timeline loader stuff
Instead of accessing MPContext in player/timeline/*, create a separate
context struct, which the timeline loaders fill out. It turns out that
there's not much in the way too big MPContext that these need to access.

One major PITA is managing (and closing) the set of open demuxers. The
problem is that we need a list of all demuxers to make sure no unneeded
streams are enabled.

This adds a callback to the demuxer_desc struct, with the intention of
leaving to to the demuxer to call the right loader, instead of
explicitly checking the demuxer type and dispatching manually in common
code. I also considered making the timeline part of the demuxer state,
but decided against: it's too much of a mess wrt. memory management and
threading, and also doesn't make it clear who owns the child demuxers.
With the struct timeline decoupled from the demuxer state, it's at least
somewhat clear that the child demuxers are independent from the "main"
demuxer.

The actual changes to player/timeline/* are separated in the following
commits, because they're quite verbose. Some artifacts will be removed
later as soon as there's only 1 timeline loading mechanism.

(cherry picked from commit a0a089f6a4)
2015-02-19 13:39:38 +09:00
wm4
57deaa02d5 player: use a macro to remove an element from an array
Should be equivalent.

(cherry picked from commit 969edb9e0b)
2015-02-19 13:39:38 +09:00
wm4
a6accfdad7 player: actually close files when using sub_remove
Also effects some other cases.

The real reason for this is for keeping track of which demuxers can be
closed (see following commit). Since I don't want to use reference
counting for this, some sort of simplistic mark-and-sweep is done to
determine whether a demuxer is still needed.

(cherry picked from commit f54220d951)
2015-02-19 13:39:38 +09:00
wm4
23959eb5b4 osxbundle: config file special case isn't needed anymore
The previous commit effectively fixes the mess caused by 'config' vs.
'mpv.conf', and the hack introduced by commit e01a6dac and extended by
commit db167cd4 isn't needed anymore.

(cherry picked from commit 816d7bba1f)
2015-02-16 18:16:36 +09:00
wm4
21a95f5ed9 player: undeprecate 'config' files
Actually, it's pretty simple to look for multiple filenames at once,
since mp_find_all_config_files() is already a bit "special" anyway.

See #1569. Reverts most of commit db167cd4 (keeps osx-bundle.conf).

(cherry picked from commit a27aa68dd3)
2015-02-16 18:16:28 +09:00
wm4
63304b95a1 Fix build on OSX broken by previous commit
Hopefully.

(cherry picked from commit 5247416735)
2015-02-16 18:13:29 +09:00
Julian
f4263a811f vf_vapoursynth: add display refresh rate property
This value is not necessarily trustworthy (it might change) and can be
0.

(cherry picked from commit 349067a6ab)
2015-02-16 18:13:22 +09:00
wm4
6488e77d8a player: deprecate 'config' files (use mpv.conf), warn against clashes
Apparently there's at least one distro which ships a /etc/mpv/mpv.conf
file (mpv doesn't install such a file). This breaks config files named
'config' located in the user's mpv config directory, because mpv first
loads files named 'config' and then 'mpv.conf'. There is no mechanism
for putting files with different names into the same config path order.
(Even worse, that mpv.conf file only set an option to the default value.
Why do distros always do very stupid things?)

Print a warning on collisions.

Although using 'config' was well-supported, supporting both names is
starting to become messy, so deprecate 'config' and print a warning if
one is found.

At least we will be able to remove the whole mess once 'config' files
are ignored...

This also affects the osx-bundle, which intentionally used these not-so-
optimal semantics. Solve it in a different way. (Unfortunately with an
ifdef - it's not required, but having to explain everyone why mpv tries
to load a osx-bundle.mpv file on Linux and Windows would consume
energy.)

Closes #1569.

(cherry picked from commit db167cd438)
2015-02-16 18:13:01 +09:00
wm4
34a856f465 command: mark get_property as deprecated
Using it just makes no sense. But we're really being nice about this and
don't remove it immediately.

(cherry picked from commit fd5403cb40)
2015-02-16 18:12:17 +09:00
wm4
440ba33639 encoding: fixed-vo option was removed
(cherry picked from commit 96547a810e)
2015-02-16 18:09:22 +09:00
wm4
e4eb9c5469 player: add a --loop=force mode
Requested. See manpage additions.

This also makes the magical loop_times constants slightly saner, but
shouldn't change the semantics of any existing --loop option values.

(cherry picked from commit aee0978d50)
2015-02-16 18:09:12 +09:00
wm4
4387919753 osx: move code to unset input context to the right place
Setting the input context is always called, both in cplayer and libmpv,
and under HAVE_COCOA. Unsetting the input context was done only the
cplayer uninit call. Also it was under HAVE_COCOA_APPLICATION, so it was
not unset in libmpv (dangling pointer).

(cherry picked from commit c59a4f12db)
2015-02-16 18:08:58 +09:00
wm4
94123474a4 osx: move cocoa specific call out of common code
This is almost equivalent, and gets rid of the ifdef.
2015-02-16 18:08:52 +09:00
wm4
50a7aac4d7 player: drop explicit exit() calls
The code in main.c calls exit() explicitly, but the code is actually
easier to follow by simply exiting from main() instead. The exit() call
in av_log.c happens only on severely broken builds, so replace it with
abort().

(Shuts up rpmlint warnings.)

(cherry picked from commit e920a00eba)
2015-02-16 18:08:38 +09:00
wm4
b3eba216b7 Revert "player: make --force-window create the window immediately on start"
This reverts commit acc5e8f574.

As expected, some didn't like this. Others won't like this revert.
Whatever.

See #1561.

This should go into mpv 0.8.0 before it's released.

(cherry picked from commit 7bbc617019)
2015-02-12 21:39:10 +09:00
Ben Boeckel
c9558e560e tl_matroska: only check the chapter count when adding chapters
Fixes #1445 without failing in the case where file outside.mkv with N
chapters references inside.mkv with N+1 chapters. Since we don't care
about the number of chapters in inner files (yet; nested chapters would
change this, but also make chapters dynamic anyways), don't check there.
2015-02-06 11:55:16 +01:00
Ben Boeckel
aa9347883f tl_matroska: squeeze down the number of parameters
Much cleaner. The difference between timeline_info and
inner_timeline_info is that timeline_info is stuff the top-level cares
about and inner_timeline_info is just for the current chapter.
2015-02-06 11:55:15 +01:00
wm4
cfd3d5b520 player: do not autoload audio with audio files, enable autoloading
Autoload external audio files only if there's at least a video track
(which is not coverart pseudo-video).

Enable external audio file autoloading by default. Now that we actively
avoid doing stupid things like loading an external audio file for an
audio-only file, this should be fine.

Additionally, don't autoload subtitles if a subtitle is played.
Although you currently can't play subtitles without audio or video,
it's disturbing and stupid that the player might load subtitle files
with different extension and then fail.
2015-02-05 22:14:17 +01:00
wm4
868d0f1e83 matroska: warn against mismatching segments
Matroska ordered chapters require all segment files to have the same
layout. If a referenced file has more tracks than the main file or
misses some tracks, the file is invalid.

Also see issue #1553.
2015-02-04 23:04:21 +01:00
wm4
59dc351772 player: move timeline specific handling to timeline loaders
In particular, gets rid of the Matroska specifics from the common code.
2015-02-04 23:04:21 +01:00
wm4
e163284b68 command: add on_unload hook
Fixes #1552.
2015-02-04 23:04:01 +01:00
wm4
acc5e8f574 player: make --force-window create the window immediately on start
Before this change, window creation was delayed until the video was
initialized. This guaranteed that the first window size was that of the
video, so the WM would place it correctly.

Some time ago, it was requested on the IRC channel that --force-window
should not do this. Sometimes, it can take a while until video is
initialized, e.g. when youtube-dl is used (which incurs lots of network
delay). In this case, it's awkward that it takes so long until a window
(any window) is shown.

On the other hand, this can cause incorrect window placement with some
WMs. We simply hope that this won't happen with modern WMs. (Although it
does with the WM I use, crappy old IceWM.)
2015-02-03 23:19:38 +01:00
wm4
c3c714b059 player: remove --fixed-vo
In ancient times, this was needed because it was not default, and many
VOs had problems with it. But it was always default in mpv, and all VOs
are required to deal with it. Also, running --fixed-vo=no is not useful
and just creates weird corner cases. Get rid of it.
2015-02-03 23:11:08 +01:00
xylosper
95fd83a269 command: new commands audio_add/audio_remove/audio_reload
These commands are counterparts of sub_add/sub_remove/sub_reload which
work for external audio file.

Signed-off-by: wm4 <wm4@nowhere>
(minor simplification)
2015-02-03 13:53:39 +01:00
Stefano Pigozzi
a3be14683a command: add property returning detected audio device
This can be useful to adjust some other audio related properties
at runtime depending on the audio device being used.
2015-02-03 00:40:02 +01:00
wm4
2a9534871d command: add property returning detected hwdec API
This is somewhat imperfect, because detection of hw decoding APIs is
mostly done on demand, and often avoided if not necessary. (For example,
we know very well that there are no hw decoders for certain codecs.)

This also requires every hwdec backend to identify itself (see hwdec.h
changes).
2015-02-02 22:43:13 +01:00
wm4
c07e046bfa player: add external audio file auto-loading
Apparently some people want this. Not enabled by default.

Fixes #967.
2015-02-02 21:23:12 +01:00
wm4
c8631b3b06 command: add properties returning the current VO and AO driver
This wasn't possible before.
2015-02-02 18:07:37 +01:00