Commit Graph

44423 Commits

Author SHA1 Message Date
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
wm4 3a78eefc88 demux_mkv: don't recursively resolve timeline for opened reference files
Instead, resolve all references and so on in the top-level timeline.
2016-10-22 17:17:04 +02:00
wm4 1bf474e19a options: make --load-scripts runtime changeable
Just that actually changing it at runtime won't do anything.

This deals with a nasty initialization order issue with encoding.
Encoding is initialized after options have initialized, but before
--load-scripts is checked and executed. Encoding initialization accesses
FFmpeg API, thus it has to run after FFmpeg is initialized (which also
implies it's initialized after options/logging init). On the other hand,
it sets the encoding builtin profile, which possibly sets --load-scripts
to "no". That failed at this point because --load-scripts was marked as
fixed.

Just marking it as not fixed gets rid of the headache, even if it's not
perfectly orthodox.
2016-10-22 16:39:24 +02:00
wm4 bf5c4c42fa command: silence deprecation warnings with --reset-on-next-file=all
--reset-on-next-file=all triggers m_config_backup_all_opts(), which
backups all options (even deprecated ones). Later, when the option
values are reset with m_config_restore_backups(), mp_on_set_option() is
called, which in turn calls mp_property_do_silent(), which in turn will
call mp_property_generic_option() and m_config_get_co(), which triggers
the deprecation message.

Unfortunately there's no good way to determine whether an option has
actually changed (there's no option value compare operation), so the
deprecated options have to be set no matter what. On the other hand, we
can't pass through additional flags through the property layer. So we
add a dumb global flag to silence the deprecation warnings in these
cases.

Fortunately m_config_get_co_raw() works to silence the warnings.
m_config_get_co() also resolves aliases (deprecated and non-deprecated),
but aliased options are handled differently by the option-property
bridge, so we don't need to do that here, so the only purpose of it is
to trigger a warning for deprecated (non-alias) options.
2016-10-22 16:02:52 +02:00
wm4 11b8cbcce7 command: fix reset-on-next-file=all and tv-freq option
The tv-freq options and properties use different types, thus must be
treated as incompatible. Fixes an assertion with reset-on-next-file=all,
which tries to set the option.

Fixes #3708.
2016-10-22 15:34:15 +02:00
wm4 082340b467 options: handle legacy no-* sub-options
These accidentally did nothing. They must be handled explicitly.

Example: --vo=vdpau:no-composite-detect

(Can't wait to get rid of this crap.)
2016-10-21 19:09:15 +02:00
wm4 5f544c1081 manpage: fix a renamed option name 2016-10-21 18:50:40 +02:00
wm4 9ea9bdf130 vo_opengl: context_rpi: fix stdatomic usage
atomic_bool is not supported with e.g. atomic_fetch_and.

Fixes #3699. Untested.
2016-10-21 17:35:48 +02:00
wm4 202f695398 vo_opengl: partially re-enable glFlush() calls
It turns out the glFlush() call really helps in some cases, though only
in audio timing mode (where we render, then wait for a while, then
display the frame). Add a --opengl-early-flush=auto mode, which does
exactly that.

It's unclear whether this is fine on OSX (strange things going on
there), but it should be.

See #3670.
2016-10-21 17:23:26 +02:00
wm4 f64de3ea66 player: don't leave buffering during underflow
Don't leave the buffering state while the demuxer is still marked as
having underflowed. It's unclear why this hasn't been done before - with
the logic being complicated as it is, maybe there was a reason for this.

This is actually still not very reliable, but should be better than what
was before: on stream switching decoders can read packets all while the
demuxer is executing a refresh seek, which creates the underrun
situation - but nothing really totally guarantees that the underrun
state remains stable when the demuxer is back at the current demuxer
position. Anyway, it's an improvement.

The rest of the touched condition is not changed, just moved around for
cosmetic reasons.
2016-10-21 17:11:26 +02:00
wm4 61a51c57a9 demux: don't try to refresh unselected streams
This could cause nonsensical queue overflow warnings, but was otherwise
probably harmless.
2016-10-21 17:11:26 +02:00
Rodger Combs b8b3163b85 wscript: rebuild on library header changes
In particular, libav<x>/version.h changing should trigger a rebuild
2016-10-21 17:11:26 +02:00
Thomas Nagy d38baa65ca build: Set a default error message for #3692
This change will prevent annoying exceptions from
appearing when error messages are missing.
2016-10-21 17:11:26 +02:00
Aman Gupta 8b00d82b79 player: guard against MPSEEK_RELATIVE when current pts is unknown
in very rare circumstances, doing a relative seek like +1s will end up
doing an absolute seek to 00:01. this guards against that possibility.

so far i've only ever seen this issue when using --ad=lavc:ac3_at and
doing several relative seeks in quick succession. this is likely either
a bug in the audiotoolbox decoder in ffmpeg, or simply due to inherent
latency in that hardware decoder which causes brief periods of time
where the current audio pts is unknown.
2016-10-21 17:11:26 +02:00
Aman Gupta 7cd32ec29e audio: force pts_reset only when pts jumps forward more than 5s
i've seen several mpegts samples where pts jumps backwards and repeats
itself. this usually happens on live tv streams from cable providers,
particularly when the stream switches from one advertisement to another.
2016-10-21 17:11:26 +02:00
Aman Gupta 183af9d72e player: speed up audio/video re-sync when there is a huge delay
when there is a huge delay between audio/video sync, it can take a
really long time to converge back. this speeds up the resync time by
increasing the max_change allowed per iteration.

Signed-off-by: wm4 <wm4@nowhere>
2016-10-21 17:11:26 +02:00
Ricardo Constantino ea03ae157f
TOOLS/appveyor-install: install uchardet release instead 2016-10-21 15:25:18 +01:00
Ricardo Constantino a6da4faac5
osc: fix crash after reaching a certain position in limited lists
Don't try to display more items than there are in the chapter/playlist.
Fixes #3691
2016-10-20 19:07:35 +01:00