summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* DOCS/edl-mpv: document a dumb thingwm42019-09-191-0/+3
| | | | | | | | | | | | | | EDLs can be provided either as external file, or "inline" as a big edl:// URL. There is no difference between them, except if it's loaded from an external file, there is some weird filename sanitation going on (see fix_filenames() in demux_edl.c). It seems this is intended to be a security mechanism, but probably makes no sense at all. Note that playlists are allowed to access anything locally. One difference to playlists is that the EDL code lacks the "security" mechanism when accessing playlist entries (see handling of the playlist_entry.stream_flags field - EDL would need something similar), so don't remove that, as I'm unaware of the exact consequences.
* command: make playlist builtin OSD property show titles instead of URLswm42019-09-191-5/+8
| | | | Useful for ytdl.
* stream_libarchive: fix another crash with broken rar fileswm42019-09-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | libarchive (sometimes affectionately called libcve) has this annoying behavior that if after a "fatal" error, you do any operation on the archive context other than querying the error and closing the context, you get a free CVE. So we close the archive context in these situations. This can set p->mpa to NULL, so code accessing this field needs to be careful. This was not considered in a certain code path, and a simple truncated .rar file made it crash. Part of the problem was that the file inside the rar was a mkv file, which triggered seeking when the demux_mkv resync code encountered bogus data. This is probably a regression from a relatively recent change to this code (in any case mpv 0.29.1 doesn't crash). Fix this by adding the check. There's also a mechanism to reopen an archive context used to emulate seeking, since most libarchive format handlers don't support this natively. Add a reopen call to the codepath, because obviously it should always be possible to seek back into a "working" area of the file. There is a second bug with this: if reopening fails, we don't adjust the current position back to 0, which in some cases means we accidentally return bogus data to the reader when we shouldn't. Fix this by always resetting the position on reopening.
* sub/sd_ass: always set the libass track type to TRACK_TYPE_ASSJan Ekström2019-09-191-2/+1
| | | | | | | | It would always autodetect it based on the passed style block, but as we are defining it - we might as well define it always. (As far as I can see all decoders in libavcodec utilize 4+ style blocks)
* sub/sd_ass: utilize UINT32_MAX subtitle duration for unknownJan Ekström2019-09-192-9/+12
| | | | | US closed captions, teletext and ARIB caption decoders utilize this value.
* sub/lavc_conv: switch to the newer "ass" subtitle decoding modeJan Ekström2019-09-193-5/+22
| | | | | Existing since 2016, this removes timestamps from the lines, and gives more precision in the timestamps (1:1000).
* wayland: fix wl_proxy leakdudemanguy2019-09-191-0/+3
| | | | | | | | | | | | | | | | | | This one is probably not terribly obvious from just the valgrind log, but a wayland dev explained it to me just a second ago. Whenever mpv sends events to the screen with wl_display_dispatch, wayland internally allocates memory to a struct wl_proxy object if a new id is found. Quite a few more things happen to that proxy object, but eventually mpv stores the data on the client-side in a wrapper type of struct (struct wl_data_offer). mpv's data_device_listener keeps track of those proxies and frees the memory when appropriate. Of course, mpv is constantly sending events to the screen and does so until the user quits the player. What happens here is that one final wl_display_dispatch is called right before the user quits the player and before mpv's data_device_listener can handle that object. So the result is that you always have one extra dangling proxy that doesn't get properly freed. The solution is to just simply call wl_data_offer_destroy before closing the wl_display to free that final dangling wl_proxy.
* drm: fix libmpv ABI breakage introduced in ↵Anton Kindestam2019-09-188-29/+48
| | | | | | | | | | | | | | | 351c083487050c88adb0e3d60f2174850f869018 Extending the client-allocated mpv_opengl_drm_params struct constituted a break of ABI that could cause UB. Create a clean break by deprecating "drm_params" and related structs and enum values, and replacing it with "drm_params_v2". Also fix some comments and code that wrongly assumed that open could return any other negative number than -1 for failure. This commit updates the libmpv version to 1.104
* stream: stop randomly corrupting memorywm42019-09-181-1/+2
| | | | | | | | | | | | | | | | | | | | The intent of the line above the modified one code was raising the amount of read data, so that many stream_peek() calls with small len values would not degrade performance by effectively turning every stream_peak() into an unbuffered read call to the stream implementation. So this confusing looking MPMAX() was correct, but "chunk" could still get beyond the buffer. So just fix that and limit "chunk" correctly. I'm not sure whether the commit referenced below accidentally removed some intricate guarantee that this couldn't happen, since the code was around since 2013. It could have relied on TOTAL_BUFFER_SIZE > STREAM_BUFFER_SIZE. But not sure. I've rewritten all this code in my own branch a year ago, so who knows. Fixes: 162e0f5ad92116d Fixes: #6948
* vo_gpu: hwdec_vaapi: Refactor Vulkan and OpenGL interops for VAAPIPhilip Langdale2019-09-157-332/+474
| | | | | | Like hwdec_cuda, you get a big #ifdef mess if you try and keep the OpenGL and Vulkan interops in the same file. So, I've refactored them into separate files in a similar way.
* vo_gpu: hwdec_cuda: Improve interop selection mechanismPhilip Langdale2019-09-154-15/+20
| | | | | | This change updates the interop selection to match what I did for VAAPI, by iterating through an array of init functions until one of them works.
* vo_gpu: x11: remove special vdpau probing, use EGL by defaultwm42019-09-154-32/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally, vo_gpu/vo_opengl considered the case of Nvidia proprietary drivers, which required vdpau/GLX, and Intel open source drivers, which require vaapi/EGL. Since window creation and GPU context creation are inseparable in mpv's internal API, it had to pick the correct API very early, or hardware decoding wouldn't work. "x11probe" was introduced for this reason. It created a GLX context (without showing the window yet), and checked whether vdpau was available. If yes, it used GLX, if not, it continued probing x11/EGL. (Obviously it couldn't always fail on GLX without vdpau, which is why it was a separate "probe" backend.) Years passed, and now the situation is different. Vdpau is dead. Nvidia drivers and libavcodec now provide CUDA interop, which requires EGL, and fixes some of the vdpau problems. AMD drivers now provide vaapi, which generally works better than vdpau. Intel didn't change. In particular, vaapi provides working HEVC Main10 support. In theory, it should work on vdpau too, with quality reduction (no 10 bit surfaces), but I couldn't get it to work. So always prefer EGL. And suddenly hardware decoding works. This is actually rather important, because HEVC is unfortunately on the rise, despite shitty encoders and unoptimized decoders. The latter may mean that hardware decoding works better than libavcodec. This should have been done a long, long time ago.
* vf_vavpp: disable this filterwm42019-09-151-0/+9
| | | | | Might be unreasonable, but I'm angry at the shit driver freezing my machine.
* vo_gpu: correctly normalize src.sig_peakNiklas Haas2019-09-151-1/+4
| | | | | | | | | | | | | In some cases, src.sig_peak remains undefined as 0, which was definitely the case when using the OSD, since it never got passed through the usual color space normalization process. Most robust work-around is to simply force the normalization at the site where it's needed. This ensures this value is always valid and defined, to make the peak-dependent logic in these two functions always work. Fixes 4b25ec3a9d Fixes #6917 Fixes #6918
* image_writer: add webp-compression optionsfan52019-09-144-0/+10
|
* image_writer: add WebP support (lossy or lossless)sfan52019-09-144-7/+55
|
* image_writer: move convert_image() to player/screenshot.csfan52019-09-145-10/+49
|
* DOCS: remove references to --video-stereo-modeNiklas Haas2019-09-144-20/+7
| | | | | | | This option was removed by a5610b2a but the documentation persisted. Also adds an OPT_REMOVED. Closes #6938.
* README: remove old googlegroups mailing list addresswm42019-09-141-3/+0
| | | | Is anyone still monitoring this in any way? I think not.
* manpage: minor fixes to VO manpagesfan52019-09-141-3/+3
|
* vo: add warning message to vo_vaapi and vo_vdpausfan52019-09-142-0/+10
| | | | | These are a common source of bug reports, due to misconceptions that they are required to make use of hardware decoding.
* vo_d3d11/context: fix crash due to ctx->ra is null pointer accessHui Jin2019-09-141-2/+4
| | | | 'ctx->ra' is null pointer when d3d11 init failed before call 'ra_d3d11_create' in 'd3d11_init'.
* vo_d3d11/hwdec_dxva2dxgi: fix memory leak that 'ctx11' be not releaseHui Jin2019-09-141-0/+6
| | | | 'ctx11' be not release when d3d11 hwdec be uninit with 'mapper_uninit' method.
* stream_smb: remove unnecessary short write logicwm42019-09-141-11/+4
| | | | See previous commit. It compiles, but 100% untested.
* stream_file: remove unnecessary short write logicwm42019-09-141-10/+1
| | | | See previous commit.
* stream: handle short writeswm42019-09-141-7/+10
| | | | | | | | The write functionality is almost unused (only encoding 2-pass mode uses it to write the log file). Moreover, it almost makes no sense to use this in a not local scenario. This change is just to prevent people from duplicating the short write logic across all streams that happen to support writing. Mostly untested; local log file writing still works.
* ci: remove now unuspported libdvdreadwm42019-09-132-2/+0
|
* demux, stream: remove old rar support in favor of libarchivewm42019-09-138-732/+1
| | | | | | The old rar code could do uncompressed rar, libarchive supports at least some rar compression algorithms. There is no need to keep the old rar code.
* command, demux: remove program propertywm42019-09-135-133/+1
| | | | | | | | | The "program" property could switch between TS programs. It was rather complex and rather obscure (even if you deal with TS captures, you usually don't need it). If anyone actually needs it (did anyone ever attempt to even use it?), it should be rewritten. The demuxer should export a program list, and the frontend should handle the "cycling" logic.
* stream: remove some more optical disc leftoverswm42019-09-132-15/+0
|
* Remove classic Linux analog TV support, and DVB runtime controlswm42019-09-1327-6236/+13
| | | | | | | | | | | | | | | | | | | | | | | | Linux analog TV support (via tv://) was excessively complex, and whenever I attempted to use it (cameras or loopback devices), it didn't work well, or would have required some major work to update it. It's very much stuck in the analog past (my favorite are the frequency tables in frequencies.c for analog TV channels which don't exist anymore). Especially cameras and such work fine with libavdevice and better than tv://, for example: mpv av://v4l2:/dev/video0 (adding --profile=low-latency --untimed even makes it mostly realtime) Adding a new input layer that targets such "modern" uses would be acceptable, if anyone is interested in it. The old TV code is just too focused on actual analog TV. DVB is rather obscure, but has an active maintainer, so don't remove it. However, the demux/stream ctrl layer must go, so remove controls for channel switching. Most of these could be reimplemented by using the normal method for option runtime changes.
* stream: remove BD/DVD/CDDA sector size alignmentwm42019-09-135-16/+4
| | | | | | This was possibly needed by libdvdread, and/or old CD drivers on some system. It still works with on-filesystem DVD and BD test images, so this can go.
* Remove optical disc fancification layerswm42019-09-1314-968/+25
| | | | | | | | | | | | | | | | | This removes anything related to DVD/BD/CD that negatively affected the core code. It includes trying to rewrite timestamps (since DVDs and Blurays do not set packet stream timestamps to playback time, and can even have resets mid-stream), export of chapters, stream languages, export of title/track lists, and all that. Only basic seeking is supported. It is very much possible that seeking completely fails on some discs (on some parts of the timeline), because timestamp rewriting was removed. Note that I don't give a shit about optical media. If you want to watch them, rip them. Keeping some bare support for DVD/BD is the most I'm going to do to appease the type of lazy, obnoxious users who will care. There are other players which are better at optical discs.
* stream_dvdnav: merge stream_dvd_commonwm42019-09-134-206/+106
| | | | Isolate icky DVD garbage into a single file.
* Remove libdvdread support in favor of libdvdnavwm42019-09-136-1031/+3
| | | | | | | | | | | stream_dvd.c contained large amounts of ancient, unmaintained code, which has been historically moved to libdvdnav. Basically, it's full of low level parsing of DVD on-disc structures. Kill it for good. Users can use the remaining dvdnav support (which basically operates in non-menu mode). Users have reported that libdvdread sometimes works better, but this is just libdvdnav's problem and not ours.
* stream_file: avoid redundant freeAman Gupta2019-09-111-1/+0
| | | | | | | s->priv->cancel will be freed when s is freed, so freeing it explicitly is not required. Signed-off-by: Aman Gupta <aman@tmm1.net>
* js: expose mpv_abort_async_command() (match dbe831bd)Avi Halachmi (:avih)2019-09-113-3/+26
| | | | With minor difference from lua, as documented.
* js: reimplement subprocess_detached using the run command (match 7f91e268)Avi Halachmi (:avih)2019-09-112-32/+5
|
* js: reimplement subprocess using the subprocess command (match 548ef078)Avi Halachmi (:avih)2019-09-112-72/+21
| | | | | | | | | Semantics changes are the same as at 548ef078 . Also, the previous C implementation returnd a string for the `stdout` value, but stdout of the subprocess command is MPV_FORMAT_BYTE_ARRAY which js previously didn't support, so support it too (at pushnode) by returning it as a string - the same as the lua code does.
* js: expose async commands (match 159379980e)Avi Halachmi (:avih)2019-09-113-2/+42
|
* js: correctness: use integer range checksAvi Halachmi (:avih)2019-09-111-18/+18
| | | | | | | | | | | There were some cases where a js number (double) was blindly casted to int or uint64, but that can be undefined behavior (out of range to int) or wrong (negative to uint). Now the code throws a js error if the value is out of range. Additionally, commit ec625266 added these checks for the new hooks API, but incorrectly tested int64 range rather than uint64. Fix this too.
* audio: block ao buffer for keep-opendudemanguy2019-09-091-1/+4
| | | | | | This prevents the pause state from triggering before the audio output is finished playing back audio. This is particularly helpful for gapless audio.
* vo_gpu: x11egl: support Mesa OML sync extensionwm42019-09-082-1/+25
| | | | | | | | | | | | | | | | | | | | Mesa supports the EGL_CHROMIUM_sync_control extension, and it's available out of the box with AMD drivers. In practice, this is exactly the same as GLX_OML_sync_control, but for EGL. The extension specification is separate from the GLX one though, and buried somewhere in the Chromium code. This appears to work, although I don't know if it really works. In theory, this could be useful for other EGL targets. Support code for it could have been added to egl_helpers.c to avoid some minor duplicated glue code if another EGL target were to provide this extension. I didn't bother with that. ANGLE on Windows can't support it, because the extension spec. explicitly requires POSIX timers. ANGLE on Linux/OSX is actively harmful for mpv and hopefully won't ever use it. Wayland uses EGL, but has its own fancy presentation feedback stuff (and besides, I don't think basic video player functionality works on Wayland at all). context_drm_egl maybe? But I think DRM has its own stuff.
* vo_gpu: glx: move OML sync code to an independent filewm42019-09-084-96/+146
| | | | | | | | | | | | | | | | | So the next commit can make EGL use it. EGL has a quite similar function, that practically works the same. Although it's relatively trivial, it's still tricky, and probably shouldn't end up as duplicated code. There are no functional changes, except initialization, and how failure of the glXGetSyncValues call is handled. Also, some comments mention the EGL extension. Note that there's no intention for this code to handle anything else than the very specific OML sync extension (and its EGL equivalent). This is just too weirdly specific to the weird idiosyncrasies of the extension, and it makes no sense to extend it to handle anything else. (Such as Wayland or DXGI presentation feedback.)
* vo/gpu: fix check on src/dst peak mismatchNiklas Haas2019-09-051-1/+1
| | | | | | | | | | In the past, src peak was always equal to or higher than dst peak. But since `--target-peak` got introduced, this could no longer be the case. This leads to an incorrect result (scaling for peak mismatch in gamma light) unless some other option (CMS, --linear-scaling, etc.) forces the linearization. Fixes #6533
* external_files: add .lrc subtitle extensionGuido Cella2019-09-021-1/+1
|
* demux: ignore forced demuxer type for directoriesTom Yan2019-09-021-1/+1
| | | | this for example allows --demuxer=rawaudio to work on directories
* stream_dvb: Increase timeout of streaming read.Oliver Freyermuth2019-09-021-1/+1
| | | | It seems some DVB-T2 cards take longer to push out data.
* stream_dvb: Adapt to VDR channel config format.Oliver Freyermuth2019-09-021-3/+8
| | | | | | | While they accept the frequency field with MHz for DVB-S, for DVB-C and DVB-T, it may be in Hz, kHz or MHz. The official rule is to multiply whatever is in the channels.conf by 1000 until a value > 1000000 is reached to get correct units for tuning.
* osc: improve look of seekrangesJan Janssen2019-09-023-101/+291
|
* cocoa-cb: remove an unused variableder richter2019-09-021-1/+0
|
* ao_opensles: fix delayed audiosfan52019-09-021-1/+1
| | | | | This was forgotten in commit 5a8c48fde2a26fe00c3552e3ccf83a965b6d3576 when the number of buffers was reduced to 1.
* travis: rework scripts to re-enable macOSJan Ekström2019-09-023-10/+106
| | | | | | | | | | | | | * Adds a script to clone and build FFmpeg as well as to configure and build mpv itself. Currently only used for macOS and contain hard-coded macOS specific options. * Still works with the Linux containers. * Moves our language back to "c" from "generic" * Defines our Linux distribution as "bionic" to get the latest Ubuntu base distribution to be the runner for our containers. * Adds the homebrew add-on for macOS package installation for dependencies. Installs everything required but FFmpeg, as we want to have our own FFmpeg snapshots.
* vo/gpu: vulkan: Pass the device name option through to libplaceboPhilip Langdale2019-08-241-0/+1
| | | | | | | | | We collect a 'vulkan-device' option today but then don't actually pass it on, so it's useless. Once that's fixed, it can be used to select a specific vulkan device by name. Tested with the new nvidia offload feature to select between the nvidia and intel GPUs.
* vo_gpu: d3d11: fix storage lifetime of compound literalsJames Ross-Gowan2019-08-201-8/+15
| | | | | | | | | | | | | | | | Somehow I got the idea that compound literals had function-scoped lifetime. Instead, like all other objects with automatic storage duration, compound literals are block-scoped, so they become invalid after exiting the block they were declared in. It seems like a recent change to GCC actually reuses the memory that the compound literals used to occupy, which was causing a few bugs. The pattern of conditionally assigning a pointer to a compound literal was used in a few places in ra_d3d11 where the Direct3D API expects either a pointer to an initialised struct or NULL. Change these to ensure the lifetime of the struct includes the API call. Should fix #6775.
* encode: set sample_aspect_ratio on AVStream structekisu2019-08-141-0/+5
| | | | | Some libavformat muxers (e.g. matroskaenc.c) expect this field to be set on the AVStream struct, and not only in the AVCodecParameters.
* vo_gpu: fix taking screenshots of rotated videoswnoun2019-08-141-2/+6
|
* vo_gpu: hwdec_vaapi: Synchronise after exporting VA surfacePhilip Langdale2019-08-071-0/+3
| | | | | | | This is documented as required (although we did not do it in the old GL codepath, with no visible problems) and I have seen transient artifacts after seeking which _appear_ to have gone away after introducing this.
* DOCS/compile-windows: remove angleproject-git from depsRicardo Constantino2019-07-301-1/+1
| | | | | Basically just to trigger a doc rebuild, but might as well do a useful change, since angleproject-git is no longer a valid package in MSYS2.
* TOOLS/travis-rebuild-website: update condition after docker transitionRicardo Constantino2019-07-301-1/+1
| | | | Closes #6822
* cocoa-cb: migrate to swift 5 with swift 4 fallbackder richter2019-07-219-85/+143
| | | | | | | | | |<