Commit Graph

41873 Commits

Author SHA1 Message Date
wm4 e6fd6d6e49 vo_rpi, vo_opengl: do not globally terminate EGL on VO uninit
eglTerminate() affects the EGLDisplay in all threads. Since the RPI
firmware apparently only ever uses EGL_DEFAULT_DISPLAY, this means it
will trash all other contexts on other threads in the same process.

Thus we don't call eglTerminate() at all, at least on RPI. Call
eglReleaseThread() instead (which may or may not be a NOP).
2015-08-31 19:46:02 +02:00
wm4 fb94744595 vo_opengl: fix alpha video in one case
yuva444p worked, yuva420p didn't. This happened because the chroma pass
discards the alpha plane, which is referenced by the alpha blend code
later.

Add a terrible hack to work this around, actually using the same hack as
was used for the Y plane. (A terrible hack for terrible code.)
2015-08-30 23:05:49 +02:00
wm4 82f0d373fb video: make container vs. bitstream aspect ratio configurable
Utterly idiotic bullshit.

Fixes #2259.
2015-08-30 23:04:17 +02:00
Kevin Mitchell 061b947c84 w32: shift drag and drop appends
use the append to playlist functionality if shift is pressed while dropping
2015-08-30 05:55:16 -07:00
Kevin Mitchell 638322f77e x11: drag and drop append with modifier
If the drag and drop action is anything other than
XdndActionCopy, append the dropped files rather than
replacing the existing playlist. With most file managers,
this will mean at least pressing shift while dropping.
2015-08-30 05:28:30 -07:00
Kevin Mitchell c80b7eed53 input: add append argument to file drop event
This puts in place the machinery to merely append dropped file to the playlist
instead of replacing the existing playlist. In this commit, all front-ends
set this to false preserving the existing behaviour.
2015-08-30 05:28:24 -07:00
Kevin Mitchell f14f6fdb31 osc: reinit on playlist changes
This takes care of the corner case where the player is started with a
single playlist entry so that the next/prev arrows are greyed out, but
remain that way even after new elements are added to the playlist.
2015-08-29 02:17:21 -07:00
wm4 2cfa62e651 player: slightly better error reporting when opening file fails
Return MPV_ERROR_LOADING_FAILED instead of MPV_ERROR_NOTHING_TO_PLAY.
2015-08-28 20:51:29 +02:00
wm4 ed0bc8b64f client API: improve an error message
This refers to media played by mpv, and these don't necessarily have to
be files. They can be network resources or entirely abstract URLs too.
2015-08-28 20:50:32 +02:00
torque ef5f4b4d9a osc: exit tick immediately if disabled.
Even after it has been disabled with the `disable-osc` message, the OSC
continues to run the tick function. Completely preventing tick from
being called is impractical since there are several different places
that it's called in the code, so just make it immediately return if the
OSC has been disabled.

This prevents the OSC from continuing the clear the OSD on every tick,
allowing other scripts to disable it so that they may draw to the OSD.
2015-08-28 09:49:52 +02:00
wm4 c61675320b sd_ass: assume negative durations are unknown durations, and handle them
The FFmpeg can officially not distinguish between unknown subtitle
durations, and subtitle durations being 0. (It documents the value 0
meaning unknown duration.)

In practice, at least the LRC demuxer signals unknown subtitle durations
with a negative value.

Assume negative durations mean unknown duration. Show subtitles with
unknown duration forever. Unless there's a subtitle event following it;
then reset the duration so that it ends on the new subtitle event.

Fixes #2244.
2015-08-27 23:45:02 +02:00
ChrisK2 3c86bd2bb5 ytdl: catch bogous extractor info
Some extractors may claim to have extracted subtitles, but then
set the relevant fields to null. Try to catch those cases.

Fixes #2254
2015-08-27 13:42:04 +02:00
wm4 ba384fffca demux_mkv: discard broken index
Add a simplistic heuristic for detecting broken indexes. This includes
indexes with very few elements (apparently libavformat sometimes writes
such indexes, or used to), and indexes with broken timestamps.

The latter was apparently produced by very old HandBrake versions:

| + Muxing application: libmkv 0.6.1.2
| + Writing application: HandBrake 0.9.1

These broken files seem to be common enough that libavformat added a
workaround for them in 2008 (and maybe again in 2015). Apparently all
timestamps are multiplied with the file's tc_scale twice, and FFmpeg
attempts to fix them. We should throw away the whole thing.
2015-08-26 22:47:07 +02:00
wm4 dae464a491 demux_mkv: don't read index twice
Actually, this never happened, because there's logic for ignoring
duplicate header elements (which includes the seek index). This is
mostly for robustness and readability.
2015-08-26 22:42:54 +02:00
wm4 f1778d1f5b video: disable interpolation during framestepping
It just causes annoying artifacts.

Interestingly, this means keeping down the frame stepping key (".") will
play video with interpolation disabled.
2015-08-25 21:48:11 +02:00
wm4 6238491688 vo_opengl: force redraw when framestepping with interpolation
This might fix some problems when framestepping with interpolation
enabled. The problem here is that we want to show the non-interpolated
frame while paused. Framestepping is like unpausing the video for a
frame, and then pausing again. This draws an interpolated frame, and
redrawing on pausing is supposed to take care of this.

This possibly didn't always work, because vo->want_redraw is not checked
by the vo_control() code path. So wake up the VO thread (which takes
care of servicing redraw requests, kind of) explicitly.

The correct solution is getting rid of the public-writable want_redraw
field and replacing it with a new vo_request_redraw() function, but this
can come later.
2015-08-25 21:31:37 +02:00
wm4 cf94fce467 ao_alsa: fix minor memory leak
So snd_device_name_get_hint() return values do in fact have to be freed.

Also, change listing semantics slightly: if io==NULL, skip the entry,
instead of assuming it's an output device.
2015-08-25 15:45:57 +02:00
wm4 1ec1b4186c vd_lavc: bump number of allocated surfaces for hwdec with HEVC 2015-08-24 23:02:40 +02:00
wm4 2172c22ee3 vaapi: add HEVC profile entries
libavcodec does not support HEVC via VAAPI yet, so this won't work.
However, there is ongoing work to add HEVC support to VAAPI, and this
change might help with testing. (Or maybe not - but there is no harm in
this change.)
2015-08-24 23:00:45 +02:00
wm4 a48a8a746e demux_libarchive: don't allow probing to read unlimited data
Instead, allow reading 2KB only. This seems to be sufficient for
libarchive to recognize zip, 7z, rar, tar. Good enough.

This is implemented by creating an in-memory stream with a copy of
the file header. If libarchive succeeds opening this, the actual
stream is opened.

Allowing unlimited reading could break unseekable streams, such as
playing from http servers with no range request support or pipes.

Also, we try not to read too much data in the first probe pass. Some
slow network streams like shoutcast services could make probing much
slower if we allow it to read too much. In the second probing pass,
actually allow 200KB.
2015-08-24 22:26:07 +02:00
wm4 3bbcbc15a5 vda, videotoolbox: guard against unexpected pixel format
Should not happen, but since we don't control decoder video surface
allocation, anything could happen, and the code should be able to deal
with it. Untested.
2015-08-23 21:41:54 +02:00
wm4 63dc0085c8 audio: don't sleep when finishing audio resync
This should avoid unnecessary sleeping when audio playback start resync
has finished and goes into the normal playback state.

This is tricky; see e.g. commit 402fe381.
2015-08-23 21:41:09 +02:00
wm4 fb5368b159 vda, videotoolbox: fix broken condition in screenshot code
Fixes #2237.
2015-08-23 11:32:49 +02:00
wm4 5c3196d20b stream_libarchive: read tar only in "unsafe" mode
As expected, probing with libarchive is a disaster. Both libavformat and
libarchive are too eager to misdetect file formats just because files
"might" be of a specific type. In this case, it's mp3 vs. tar. To be
fair, neither file format has an actual header. I'm not sure why we'd
need tar support, but since libarchive provides it, and idiots on the
internet apparently pack media files in tar sometimes (really, idiots),
keep it for now, and probe tar last.
2015-08-22 22:13:20 +02:00
wm4 602105dbda player: add --playlist-pos option
Oddly often requested.
2015-08-22 22:08:17 +02:00
wm4 1e4113040c vo_opengl: remove dead code
Leftover from 3245bfef.
2015-08-22 21:05:32 +02:00
Ellis Berner 0e2024ef2b docs: correct typo for 'ingore-chmap'
ingore-chmap -> ignore-chmap
2015-08-22 11:50:33 +02:00
wm4 8565073f68 command: make the playback-time property writable
Provides a simplistic way to seek without having to care about weird
situations like timestamp vs. playback time. This is good, because the
seek command is currently timestamp based, so when using the seek
command the user _does_ have to care.
2015-08-21 15:53:24 +02:00
wm4 2e3ce738f5 player: return better guess for playback time during seeks
Always compute the estimated absolute time of the seek target, and
display this as playback time during seeks.

Improves behavior with e.g. .ts files, for which we try to avoid seeks
by timestamp.
2015-08-21 15:37:07 +02:00
Stian Eikeland 8a9fc9398d options: sub-file replaces subfile, instead of sub 2015-08-21 00:15:24 +02:00
Jari Vetoniemi d29e699491 gl_wayland: Wait for frame callbacks
Keep glSwapInterval(0) on to avoid blocking on gl calls, but wait for
frame callbacks so we play nice with compositor.
2015-08-21 00:01:01 +02:00
Jari Vetoniemi e05dc7bfb7 vo_wayland: Wait for frame callbacks
Privdes small api for vo_wayland where one can request frame callback
and then wait for it.

This will make vo_wayland play video smoothly.
2015-08-21 00:01:01 +02:00
Jari Vetoniemi 3245bfefc3 gl_wayland: eglSwapInterval(0) to avoid blocking
This makes mesa not wait for frame callback internally.
2015-08-21 00:01:01 +02:00
Ricardo Constantino b144da63a8 TOOLS/lua/autoload: fix adding more files at end of auto-playlist
Fixes regression in dfd8a5f that made autoload not add more files
at the end of the current playlist if playlist was made by the
script.

This still prevents loading the script if more than one (media or
playlist) file was manually added.
2015-08-20 22:05:03 +02:00
wm4 9cd929bf79 TOOLS/lua/autoload: add all files on start
Or almost. I don't know or care.

Fixes #2219 (maybe, I don't know or care).
2015-08-20 22:04:36 +02:00
wm4 addbf8faae stream_libarchive: disable raw filter
Too many false positives (it accepts things like unspecific text files),
and also relatively useless.
2015-08-20 21:56:44 +02:00
Niklas Haas e1fd80097c vo_opengl: add tscale-clamp option
This significantly reduces the amount of noticeable flashing when using
tscale kernels with negative lobes, by cutting them off completely.

I'm not sure if this has any negative effects. It needs a bit of
subjective testing over a period of time, so I just made it an option.

Fixes #2155.
2015-08-20 21:55:19 +02:00
wm4 96648169e3 vo_rpi: disable background by default
And add an option to enable it.
2015-08-20 19:07:18 +02:00
wm4 147f4956d3 player: deliver IDLE event after uninitializing state
A client API user might count on the fact that audio and video outputs
have already been uninitialized. (They remain uninitialized before
entering idle mode in order to allow smooth transition to the next
playlist entry.) Since event delivery is asynchronous, this has to
happen after actually doing the uninitialization, or the client will
essentially run into a race condition.
2015-08-20 15:25:32 +02:00
wm4 895c8801a2 gl_rpi: destroy the EGLSurface too
Most likely doesn't matter much.
2015-08-20 15:21:01 +02:00
wm4 0d5541af47 vo_rpi: use correct variable for osd layer
This is a cosmetic change, because the value is exactly the same. (The
old code just duplicates the logic, sort of.)
2015-08-20 15:20:20 +02:00
wm4 1b93a7a895 stream_libarchive: fix libarchive callback signature
libarchive uses a quite confusing ifdeffery mess for some of the types
used in callbacks. Currently, archive_read_set_seek_callback() causes a
warning at least on Windows due to mismatching return type. The header
file uses __LA_INT64_T as return type, so I think the user is intended
to use int64_t.

(The ssize_t return type for the read_cb seems correct, on the other
hand.)
2015-08-20 11:08:22 +02:00
wm4 b8fe17f2e6 vo_rpi: fix blackscreen before the first subtitle/OSD is rendered
The OSD overlay wasn't initialized, so it remained solid black until the
first time a subtitle line or an OSD element became visible.
2015-08-20 10:36:32 +02:00
wm4 3bceb37b06 old-configure: avoid a warning 2015-08-19 21:38:47 +02:00
wm4 bffd78748f vd_lavc: remove unneeded hwdec parameters
All hwdec backends now use a single pixel format, and the format is
always checked.

Also, the init_decoder callback is now mandatory.
2015-08-19 21:33:18 +02:00
wm4 cab1f6439c video: don't decode 2 frames ahead with display-sync
This is not needed. It was used only temporarily in a development
branch, and is a leftover from earlier rebasing.
2015-08-19 21:24:56 +02:00
Stefano Pigozzi d0e19b659e build: make sure the HAVE_ key is undefined on failure
Some particular checks can define the HAVE_ key on their own. To make sure
they work correctly when composed (with compose_checks) we force the HAVE_
key to be undefined if a check fails.
2015-08-19 00:15:41 +02:00
Stefano Pigozzi 2dac2efce4 Revert "build: workaround for broken waf crap"
This reverts commit 1b7883a3e5.
2015-08-19 00:12:33 +02:00
wm4 1b7883a3e5 build: workaround for broken waf crap
Even though the rpi check fails, it'll define "HAVE_RPI 1" in config.h.
Why? Who knows...
2015-08-18 23:57:00 +02:00
wm4 4427fa9900 stream_libarchive: restrict number of allowed formats
Most of what is not in this list is extremely obscure, or increases the
file format misdetection rate.
2015-08-18 23:26:40 +02:00