Commit Graph

44190 Commits

Author SHA1 Message Date
wm4 b787a4121a demux_timeline: always signal new segment after a seek
This is needed to put the decoders into the correct state. In
particular, decoders will not initialize the current segment without
this flag. The intention of not setting the flag for seeks within the
segments were to avoid costly decoder reinits, but it seems this is
better handled explicitly in the decoder wrappers.
2016-11-09 16:44:06 +01:00
Ricardo Constantino adf65634d8
osc: add seekbarstyle=knob
Most code from @leiserfg in #2365.
Closes #2365

Cut guides to the center of the knob. This makes the knob
knob look more like IRL knob sliders.
2016-11-09 05:51:20 +00:00
Ricardo Constantino 5beb230690
osc: fix crashes when dragging seekbar across file changes
Fixes #3210
2016-11-08 21:18:53 +00:00
Avi Halachmi (:avih) 616ecd9365 options: fnmatch: check existence instead of posix 2016-11-08 19:16:35 +01:00
Niklas Haas c676c31815 demux: expose demuxer colorimetry metadata to player
Implementation-wise, the values from the demuxer/codec header are merged
with the values from the decoder such that the former are used only
where the latter are unknown (0/auto).
2016-11-08 19:16:26 +01:00
Niklas Haas 81ceb7b6a5 demux_mkv: parse colorimetry metadata
Matroska actually has lots of colorimetry metadata that video tracks can
use, including mastering metadata (HDR signal peak) etc.

This commit adds the EBML definitions and parses the most basic fields.
Note that nothing uses these fields yet, this commit is just adding the
necessary parsing and infrastructure.
2016-11-08 19:16:24 +01:00
wm4 33012b4141 ao_alsa: fill unused ALSA channels with silence
This happens when ALSA gives us more channels than we asked for, for
whatever reasons. It looks like this wasn't handled correctly. The mpv
and ALSA channel counts could mismatch, which would lead to UB.

I couldn't actually trigger this case, though. I'm fairly sure that
drivers or plugins exist that do it anyway. (Inofficial ALSA motto: if
it can be broken, then why not break it?)
2016-11-08 17:49:40 +01:00
wm4 1d51dc20ea ao_alsa: strictly disable chmap use for mono/stereo
If the input is already mono or stereo, or if channel map selection
results in mono or stereo, then disable further use of the champ ALSA
API (or rather, stop trusting its results). Then we behave like a simple
application that only wants to output mono or stereo.

See #3045 and #2905. I couldn't actually test these cases, but this
commit is supposed to fix them.
2016-11-08 17:49:13 +01:00
wm4 2e113a7391 ao_alsa: _really_ disable chmap API use in cases where we should
set_chmap() skipped _setting_ the ALSA chmap if chmap use was requested
to be disabled by setting dev_chmap.num=0 by the caller, but it still
queried the current ALSA channel map. We don't trust it that much, so
disable that as well.

But we still query and log it, because that could be helpful for
debugging. Otherwise we could skip the entire set_chmap() call in these
cases.
2016-11-08 17:48:40 +01:00
wm4 2b71bef2ba ao_alsa: slightly better debug logging
Try to make it more compact, and also always list the reordered layout,
but only if it's actually different.

Should be the same functionally.
2016-11-08 16:59:12 +01:00
wm4 8f1ec91b45 mp_image: dump all mp_colorspace members in verbose logging
Also extend the default buffer size for formatting this string, because
it can get too damn long.
2016-11-08 14:19:26 +01:00
Ricardo Constantino 8b7f23129d
osc: slimbox: fix clipping with seekbarstyle=bar
Fixes #3737
2016-11-07 22:00:17 +00:00
wm4 6a06e6002b vo_opengl: fix --blend-subtitles handling
The intention was that if --blend-subtitles is enabled, the frame should
always be re-rendered instead of using e.g. a cached scaled frame. The
reason is that subtitles can change anyway, e.g. if you pause and change
subtitle size and such.

On the other hand, if the frame is marked as repeated, it should always
use the cached copy. Actually "simplify" this and drop the cache only if
playback is paused (which frame->still indicates indirectly).

Also see PR #3773.
2016-11-07 22:49:24 +01:00
wm4 de72cb2c33 vo_opengl: fix redrawing with hardware decoding
unmap_current_image() is called after rendering. This essentially
invalidates the textures, so we can't assume that the image is still
present.

Also see PR #3773.
2016-11-07 22:49:16 +01:00
Emmanuel Gil Peyrot 4914e688cf manpage: rename drm-egl to drm. 2016-11-07 18:42:27 +01:00
Douglas Christman 932ecbfe9e man/options.rst: fix typo 2016-11-06 04:53:55 +01:00
Nils Maier 7c9f32620f
Apply autofit-larger after autofit-smaller
This prevents the window scaling beyond screen dimensions

Fixes #3753
2016-11-03 21:30:25 +01:00
Aman Gupta 3f5b41dfa3 audio/out: add AudioUnit output driver for iOS 2016-11-01 16:25:40 +01:00
Niklas Haas 0dc1fe3269 manpage: explicitly document all scaling options
Enumerate all of the scaling-related options, even for the ``--cscale``
/ ``--tscale`` etc. variants. Unfortunately this breaks 80col quite
severely, but there's nothing I can do about it due to a bug in rst2man
preventing definition list labels from spanning multiple lines.

Also reorder some of the scaling-related options to be closer together
and in a more consistent order (for a top-to-bottom reading flow).
2016-11-01 16:25:40 +01:00
Niklas Haas 654721c27b filter_kernels: add ability to taper kernels/windows
This allows us to define the tukey window (and other tapered windows).

Also add a missing option definition for `wblur` while we're at it, to
make testing out window-related stuff easier.
2016-11-01 16:25:40 +01:00
wm4 5838322975 demux: improve buffer estimation in a corner case
This deals with the estimation of buffered packets, which is used mostly
for display, but also things like pausing on low buffer levels.

If a stream is fully EOF (no more packets), we don't want to include it
in the total buffer amount. This also means we should make ds->eof less
flaky and more stable, so don't reset it in ds_get_packets() (this
function reset ds->eof just to retrigger a packet read attempt - we can
have this slightly simpler). This somewhat fixes buffering display when
e.g. issuing a refresh seek after re-enabling audio/video when playing
with subtitles only.
2016-11-01 16:25:40 +01:00
wm4 8dff51e06c vo: clear frame repeat flag when redrawing
This makes no sense, as the flag is supposed to be used for vsync
purposes only (when literally outputting the screen again with no
changes at all), and redrawing is often used for OSD updates.
2016-11-01 16:25:40 +01:00
wm4 17733bd5b8 vo_opengl: make frame reupload logic more robust
It's not that easy to decide whether a frame needs to be
reuploaded/rerendered. Using unique frame IDs for input makes it
slightly easier and more robust. This also removes the use of video PTS
in the interpolation path.

This should also avoid reuploading the video frame if it's just redrawn
in paused mode, or when using OSD/subtitles in cover art mode.
2016-11-01 16:25:40 +01:00
Ricardo Constantino eedda59a69
osc: add alpha animation to tooltip
Fixes lingering tooltip with full alpha if mouse leaves window
with OSC still active.
2016-10-31 16:57:32 +00:00
wm4 8fad4b8eab player: enable no-video subtitle display on coverart too
Coverart mode has the same issue as no-video mode, except that the video
chain is fully active. It shows only 1 frame at the start, which would
normally mean that only the subtitle at timestamp 0 is shown. Use the
no-video subtitle rendering mode in this case instead.

(This still doesn't handle subtitle display when playing cover-art
without audio, or playing a single image. This is because there's
nothing that will advance playback_pts.)
2016-10-31 13:55:32 +01:00
wm4 bc77565838 vo_opengl_cb: fix a race condition
When pthread_cond_timedwait(), the condition we are checking for could
be true or false. This code assumed it was always false.

This should be an extremely obscure race condition, since it can happen
only if timeout and the condition changing sort of happen at the same
time, or the lock is held for a longer time (which it normally isn't).
But I could observe it a few times.
2016-10-30 18:29:24 +01:00
wm4 b0ef3dd4fb vo_opengl_cb: fix inverted condition
Commit e6291697 got this wrong.
2016-10-30 12:16:24 +01:00
wm4 1ff6d8ae2e player: don't try updating subtitles while playback PTS doesn't progress
This code would just keep it busy while e.g. being paused. Even if it's
not paused, it couldn't help with anything since we obviously still lock
display to the externally updated PTS.
2016-10-30 12:03:46 +01:00
wm4 1afc0c8b55 vo_opengl_cb: update current frame if a frame is dropped
Even if a frame is dropped due to the libmpv API user not drawing a
frame, it should be set as current frame. This avoids dropping a frame
forever in certain circumstances such as cover art of the API user was
stuck at initialization or such.
2016-10-30 12:00:33 +01:00
Ricardo Constantino a1801da717
man/osc: remove extra indentation from 3adc6071 2016-10-30 10:28:42 +00:00
Ricardo Constantino eac977b12f
osc: top/bottombar: rescale layout to same size with scale=1
Basically, there's two less values to revert to previous defaults and
top/bottombar now look at scale=1 like they looked with scale=1.5.
2016-10-29 18:14:32 +01:00
Ricardo Constantino 3adc6071b6
man/osc: Fix hard wrapping in man files 2016-10-29 18:14:30 +01:00
Ricardo Constantino 0c3e4b13ac
osc: top/bottombar: scale title if too large like box 2016-10-29 18:14:30 +01:00
Ricardo Constantino 22133f8efc
osc: compromise on default deadzonesize
This way people can still use the mouse to quickly check the elapsed time
without moving it all the way to the bottom while still having half the screen
to ignore mouse movement.
2016-10-29 18:14:29 +01:00
Ricardo Constantino 4abd23bd95
osc: don't wrap the title 2016-10-29 18:14:28 +01:00
Ricardo Constantino 993466fc30
osc: top/bottombar: also scale when min-width is reached
Same behavior as box/slimbox.
2016-10-29 18:14:19 +01:00
Ricardo Constantino ad819b5458
osc: top/bottombar: dynamically size timecodes according to timems 2016-10-29 18:14:04 +01:00
Ricardo Constantino 894dbcd1b7
osc: fix missing chapter ticks with seekbarstyle=bar 2016-10-29 18:14:02 +01:00
wm4 90b968a67a player: show subtitles on VO if --force-window is used
If a VO is created, but no video is playing (i.e. --force-window is
used), then until now no subtitles were shown. This is because VO
subtitle display normally depends on video frame timing. If there are no
video frames, there can be no subtitles.

Change this and add some code to handle this situation specifically. Set
a subtitle PTS manually and request VO redrawing manually, which gets
the subtitles rendered somehow.

This is kind of shaky. The subtitles are essentially sampled at
arbitrary times (such as when new audio data is decoded and pushed to
the AO, or on user interaction). To make a it slightly more consistent,
force a completely arbitrary minimum FPS of 10.

Other solutions (such as creating fake video) would be more intrusive or
would require VO-level API changes.

Fixes #3684.
2016-10-26 20:44:05 +02:00
wm4 fc4318d23e player: consistently initialize screensaver state with --force-window
Whether this is a good or a bad thing, make sure it's consistent.
2016-10-26 20:35:12 +02:00
Ricardo Constantino 65c06511bf
osc: fix crash with no chapters
Also, chapter position which wasn't changed to work with 1-based.
2016-10-25 15:42:40 +01:00
wm4 ee4bed25a8 command: if window-scale can't be set properly, set it as option
Kind of sketchy, but happens to fix #3724.
2016-10-25 16:05:46 +02:00
Miroslav Koskar 6953a1ca2f
osc: Fix and simplify limited_list
* Fixes: when on the end of playlist only half of entries are displayed.
* Simplifies the logic of limited_list so it's easy to follow.
* limited_list's pos parameter is now 1 based which seem more natural.
* Few changes to comply with code style thorough the file.
* Small format change:

  "Playlist: (%d/%d):"  -> "Playlist [%d/%d]:"
  "Chapters: (%d/%d):"  -> "Chapters [%d/%d]:"
2016-10-25 14:09:48 +01:00
Ricardo Constantino c8e3ee494c
osc: add script message handlers for chapter/track/playlists
These can be used in input.conf for pretty formatting of lists as
with shift+clicking the OSC buttons.

Ex:
z   script-message osc-playlist
Z   script-message osc-chapterlist
x   script-message osc-tracklist
2016-10-24 19:03:07 +01:00
Avi Halachmi (:avih) 363982c774 vo_tct: support also 256 colors output 2016-10-25 00:03:01 +11:00
Avi Halachmi (:avih) 02d2c2cc97 vo_tct: optional custom size, support non-posix with 80x25 default
Also, replace the UTF8 half block char at the source code with C escape.
2016-10-25 00:03:01 +11:00
Ricardo Constantino 6e143ffec3
man/osc: reorder a few options for better visibility
Also document pre-0.21.0 defaults.
2016-10-23 17:23:25 +01:00
wm4 61ff2408e3 manpage: document ytdl:// 2016-10-23 17:38:58 +02:00
Aman Gupta d0b997d528 player: make --start-time work with --rebase-start-time=no 2016-10-22 18:48:27 +02:00
Uoti Urpala 18681a7dd2 demux_mkv: fix ordered chapter sources with ordered editions
Commit f72a900892 (and others) added support for ordered editions that
recursively refer to other ordered editions. However, this recursion
code incorrectly activated if the source files had ordered chapters
even if the main file only wanted to use them as raw video, resulting
in broken timeline info overall.

Ordered chapters can specify a ChapterSegmentEditionUID value if they
want to use a specific edition from a source file. Otherwise the
source is supposed to be used as a raw video file. The code checked
demuxer->matroska_data.num_ordered_chapters for an opened source file
to see whether it was using a recursive ordered edition, but demux_mkv
could enable a default ordered edition for the file using the normal
playback rules even if the main file had not specified any
ChapterSegmentEditionUID. Thus this incorrectly enabled recursion if a
source file had a default edition using ordered chapters. Check
demuxer->matroska_data.uid.edition instead, and ensure it's never set
if a file is opened without ChapterSegmentEditionUID.

Also fix what seems like a memory leak in demux_mkv.c.

Signed-off-by: wm4 <wm4@nowhere>
2016-10-22 18:45:06 +02:00