summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* player: show demuxer cache buffered amount in bytes in the status linewm42017-12-233-6/+13
| | | | | | | | I don't want to add another field to display stream and demuxer cache separately, so just add them up. This strangely makes sense, since the forward buffered stream cache amount consists of data not read by the demuxer yet. (If the demuxer cache has buffered the full stream, the forward buffered stream cache amount is 0.)
* cache: lower default size to 2*10MBwm42017-12-232-4/+4
| | | | | | | | | | | | Reduce it from 75MB in both directions (forward/backwards) to 10MB each. The stream cache is kind of becoming useless in favor of the demuxer cache. Using both doesn't make much sense, because they will contain duplicated data for no reason. Still leave it at 10MB, which may help with mp4 a bit. libavformat's mp4 demuxer tends to seek too much, so we try to avoid triggering network level seeks by having some caching in the stream layer.
* demux: bump the demuxer cache readahead durationwm42017-12-232-2/+4
| | | | | | Set it to 10 hours, which is practically unlimited. (Avoiding use of "inf", since that might interact strangely with the option parser and such.)
* demux: always discard cached packets on track switcheswm42017-12-231-8/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes weird behavior in the following case: - open a file - make sure the max. demuxer forward cache is smaller than the file's video track - make sure the max. readahead duration is larger than the file's duration - disable the audio track - seek to the beginning of the file - once the cache has filled enable the audio track - a queue overflow warning should appear (- looking at the seek ranges is also interesting) The queue overflow warning happens because the packed queue for the video track will use up the full quota set by --demuxer-max-bytes. When the audio track is enabled, reading an audio packet would technically overflow the packet cache by the size of whatever packet is read next. This means the demuxer signals EOF to the decoder, and once playback has consumed enough video packets so that audio packets can be read again, the decoder resumes from EOF. This interacts badly with A/V synchronization and the whole thing can randomly crap itself until audio has fully recovered. We didn't care about this so far, but we want to raise the readahead duration to something very high, so that the demuxer cache is fully used. This means this case can be hit quite quickly by switching audio or subtitle tracks, and is not really an obscure corner case anymore. Fix this by always losing all cache. Since the cache can't be used anyway until the newly selected track has been read, this is not much of a disadvantage. The only thing that could be brought up is that unselecting the track again could resume operation normally. (Maybe this would be useful if network died completely without chance of recovery. Then you could watch the already buffered video anyway by deselecting the audio track again.) But given the headaches, this seems like the better solution. Unfortunately this requires adding new new strange fields and strangely fragmenting state management functions again. I'm sure whoever works on this in the future will hate me. Currently it seems like the lesser evil, and much simpler and robust than the other potential solutions. In case this needs to be revisited, here is a reminder for readers from the future what alternative solutions were considered, without those disadvantages: A first attempted solution allowed the demuxer to buffer some additional packets on track switching. This would allow it to read enough data to feed the decoder at least. But it was still awkward, as it didn't allow the demuxer to continue prefetching the newly selected track. It also barely worked, because you could make the forward buffer "over full" by seeking back with seekable cache enabled, and then it couldn't read packets anyway. As alternative solution, we could always demux and cache all tracks, even if they're deselected. This would also not require a network-level seek for the "refresh" logic (it's the thing that lets the video decoder continue as if nothing happened, while actually seeking back in the stream to get the missing audio packets, in the case of enabling a previously disabled audio track). But it would also possibly waste network and memory resources, depending on what the user actually wants. A second solution would just account the queue sizes for each stream separately. We could freely fill up the audio packet queue, even if the video queue is full. Since the demuxer API returns interleaved packets and doesn't let you predict which packet type comes next, this is not as simple as it sounds, but it'd probably tie in nicely with the "refresh" logic. A third solution would be removing buffered video packets from the end of the packet queue. Since the "refresh" logic gets these anyway, there is no reason to keep them if they prevent the audio packet queue from catching up with the video one. But this would require additional logic, would interact badly with a bunch of other corner cases. And as far as the code goes, it's rather complex, because all the logic is written with FIFO behavior in mind (including the fact that the packet queue is a singly linked list with no backwards links, making removal from the end harder).
* travis: stop excluding ffmpeg-gitRicardo Constantino2017-12-222-3/+1
| | | | Signed-off-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
* options: deprecate --ff- options and propertieswm42017-12-215-5/+16
| | | | | | | | | | | Some old crap which nobody needs and which probably nobody uses. This relies on a GCC extension: using "## __VA_ARGS__" to remove the comma from the argument list if the va args are empty. It's supported by clang, and there's some chance newer standards will introduce a proper way to do this. (Even if it breaks somewhere, it will be a problem only for 1 release, since I want to drop the deprecated properties immediately.)
* build: use a list instead of a string for rpi cflagsScott Zeid2017-12-211-4/+4
| | | | Using a string caused all 4 flags to be passed as one argument, causing the build to fail when trying to include bcm_host.h.
* Restore Libav supportwm42017-12-213-1/+4
| | | | | | | | | | | Libav has been broken due to the hwdec changes. This was always a temporary situation (depended on pending patches to be merged), although it took a bit longer. This also restores the travis config. One code change is needed in vd_lavc.c, because it checks the AV_PIX_FMT for videotoolbox (as opposed to the mpv format identifier), which is not available in Libav. Add an ifdef; the affected code is for a deprecated option anyway.
* hwdec: remove unused fieldswm42017-12-213-9/+0
| | | | | These were replaced by a different mechanism, but the old fields weren't removed.
* vo_mediacodec_embed: implement hwcontextAman Gupta2017-12-203-2/+31
| | | | Fixes vo_mediacodec_embed, which was broken in 80359c6615658f2784
* command: make video-frame-info property observablewm42017-12-201-1/+1
| | | | Pointed out as missing by someone. Not terribly useful, but here we go.
* vo_gpu: win: remove exclusive-fullscreen detection hackJames Ross-Gowan2017-12-204-130/+0
| | | | | | | | | | | | | | | | | | | | | This hack was part of a solution to VSync judder in desktop OpenGL on Windows. Rather than using blocking-SwapBuffers(), mpv could use DwmFlush() to wait for the image to be presented by the compositor. Since this would only work while the compositor was running, and the compositor was silently disabled when OpenGL entered exclusive fullscreen mode, mpv needed a way to detect exclusive fullscreen mode. The code that is being removed could detect exclusive fullscreen mode by checking the state of an undocumented mutex using undocumented native API functions, but because of how fragile it was, it was always meant to be removed when a better solution for accurate VSync in OpenGL was found. Since then, mpv got the dxinterop backend, which uses desktop OpenGL but has accurate VSync. It also got a native Direct3D 11 backend, which is a viable alternative to OpenGL on Windows. For people who are still using desktop OpenGL with WGL, there shouldn't be much of a difference, since mpv can use other API functions to detect exclusive fullscreen.
* w32_common: refactor and improve window state handlingpavelxdd2017-12-191-131/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored and split the `reinit_window_state` code into four separate functions: - `update_window_style` used to update window styles without modifying the window rect. - `fit_window_on_screen` used to adjust the window size when it is larger than the screen size. Added a helper function `fit_rect` to fit one rect on another without using any data from w32 struct. - `update_fullscreen_state` used to calculate the new fullscreen state and adjust the window rect accordingly. - `update_window_state` used to display the window on screen with new size, position and ontop state. This commit fixes three issues: - fixed #4753 by skipping `fit_window_on_screen` for a maximized window, since maximized window should already fit on the screen. It should be noted that this bug was only reproducible with `--fit-border` option which is enabled by default. The cause of the bug is that after calling the `add_window_borders` for a maximized window, the rect in result is slightly larger than the screen rect, which is okay, `SetWindowPos` will interpret it as a maximized state later, so no auto-fitting to screen size is needed here. - fixed #5215 by skipping `fit_window_on_screen` when leaving fullscreen. On a multi-monitor system if the mpv window was stretched to cover multiple monitors, its size was reset after switching back from fullscreen to fit the size of the active monitor. Also, when changing `--ontop` and `--border` options, now only the `update_window_style` and `update_window_state` functions are used, so `fit_window_on_screen` is not used for them too. - fixed #2451 by moving the `ITaskbarList2_MarkFullscreenWindow` below the `SetWindowPos`. If the taskbar is notified about fullscreen state before the window is shown on screen, the taskbar button could be missing until Alt-TAB is pressed, usually it was reproducible on Windows 8. Other changes: - In `update_fullscreen_state` the `reset window bounds` debug message now reports client area size and position, instead of window area size and position. This is done for consistency with debug messages in handling fullscreen state above in this function, since they also print window bounds of the client area. - Refactored `gui_thread_reconfig`. Added a new window flag `fit_on_screen` to fit the window on screen even when leaving fullscreen. This is needed for the case when the new video opened while the window is still in the fullscreen state. - Moved parent and fullscreen state checks out from the WM_MOVING to `snap_to_screen_edges` function for consistency with other functions. There's no point in keeping these checks out of the function body.
* w32_common: use RECT for storing screen and window size & positionpavelxdd2017-12-191-100/+71
| | | | | | When window and screen size and position are stored in RECT, it's much easier to modify them using WinAPI functions. Added two macros to get width and height of the rect.
* client API: change --stop-playback-on-init-failure defaultwm42017-12-173-6/+7
| | | | | | | | | | | | | | | | This was off for mpv CLI, but on for libmpv. The motivation behind this was that it would be confusing for applications if libmpv continued playback in a severely "degraded" way (without either audio or video), and that it would be better to fail early. In reality the behavior was just a confusing difference to mpv CLI, and has confused actual users as well. Get rid of it. Not bothering with a version bump, since this is so minor, and it's easy to ensure compatibility in affected applications by just setting the option explicitly. (Also adding the missing next-release-marker in client-api-changes.rst.)
* vo_gpu: hwdec_drmprime_drm: don't crash for non-GL contextswm42017-12-171-0/+3
| | | | Using vulkan with --hwdec crashed because of this.
* dvb: Fix long channel switching: next/prev channelrim2017-12-161-4/+4
|
* dvb: Add multiple frontends support: MAX_FRONTENDS now 8.rim2017-12-164-88/+99
|
* js: implement mp.msg.trace()TheAMM2017-12-163-5/+8
| | | | | | | To match the new Lua helper introduced in 1afdeee1ad8bca1c703e741002fa3b882d162968 Add documentation for both.
* lua: implement mp.msg.traceNiklas Haas2017-12-151-0/+1
|
* msg: bump up log level of --log-fileNiklas Haas2017-12-152-5/+5
| | | | This now logs -v -v by default, instead of -v.
* msg: reinterpret a bunch of message levelsNiklas Haas2017-12-1518-86/+69
| | | | | | | | | | | | | | | | | | | | | | I've decided that MP_TRACE means “noisy spam per frame”, whereas MP_DBG just means “more verbose debugging messages than MSGL_V”. Basically, MSGL_DBG shouldn't create spam per frame like it currently does, and MSGL_V should make sense to the end-user and provide mostly additional informational output. MP_DBG is basically what I want to make the new default for --log-file, so the cut-off point for MP_DBG is if we probably want to know if for debugging purposes but the user most likely doesn't care about on the terminal. Also, the debug callbacks for libass and ffmpeg got bumped in their verbosity levels slightly, because being external components they're a bit less relevant to mpv debugging, and a bit too over-eager in what they consider to be relevant information. I exclusively used the "try it on my machine and remove messages from MSGL_* until it does what I want it to" approach of refactoring, so YMMV.
* README: some rewording and markdown improvementsLarivact2017-12-151-8/+8
|
* README: reorganize table of contentsLarivact2017-12-151-3/+12
| | | | | Add missing sections, make order consistent, create a new section for external links and rename "Manual" link.
* options: rename 'error' labels to 'exit' where appropriatepavelxdd2017-12-161-13/+13
|
* options: don't report errors on help value for OPT_SIZE_BOXpavelxdd2017-12-161-4/+10
| | | | | | The same idea as in 3723e61 but for OPT_SIZE_BOX now. Affects options `autofit`, `autofit-larger` and `autofit-smaller`.
* ipc: avoid dereferencing NULLMartin Shirokov2017-12-151-7/+17
| | | | | This can happen when ctr->client_api->shutting_down is set to true, or when there are over 1000 clients with the same name passed to mp_new_client().
* vd_lavc: rename --hwdec=rpi to --hwdec=mmalwm42017-12-153-6/+4
| | | | | | Annoying exception that makes no sense to keep. Normally, users or client applications will either use --hwdec=auto, or not set the option at all, which both leads to the expected result.
* vd_lavc: use libavcodec metadata for hardware decoder wrapperswm42017-12-152-26/+9
| | | | | This removes the need to keep an explicit list and to attempt to parse codec names. Needs latest FFmpeg git.
* csputils: Add support for Display P3 primariesVittorio Giovara2017-12-142-2/+5
|
* csputils: Fix DCI P3 primaries white pointVittorio Giovara2017-12-141-1/+2
|
* subprocess-win: don't change the mouse cursor in CreateProcesspavelxdd2017-12-141-1/+1
| | | | | | By default the CreateProcess changes the mouse cursor to IDC_APPSTARTING. The new flag added to STARTUPINFOEXW prevents changing the cursor from default arrow on creating a new process.
* lua+js: implement utils.file_info()TSaaristo2017-12-134-0/+109
| | | | | | | | | | | | | | | This commit introduces mp.utils.file_info() for querying information on file paths, implemented for both Lua and Javascript. The function takes a file path as an argument and returns a Lua table / JS object upon success. The table/object will contain the values: mode, size, atime, mtime, ctime and the convenience booleans is_file, is_dir. On error, the Lua side will return `nil, error` and the Javascript side will return `undefined` (and mark the last error). This feature utilizes the already existing cross-platform `mp_stat()` function.
* sd_ass: accept otc as fallback OpenType collection file extensionLeo Izen2017-12-131-1/+1
| | | | | | | The OpenType Font File specification recommends that "Collection fonts that use CFF or CFF2 outlines should have an .OTC extension." mpv should accept .otc as a fallback extension for font detection should the mimetype detection fail.
* sd_ass: accept RFC8081 font media typesLeo Izen2017-12-131-0/+4
| | | | | | | | | | IETF RFC8081 added the "font" top-level media type, including font/ttf, font/otf, font/sfnt, and also font/collection. These font formats are all supported by mpv/libass but they are not accepted as valid Matroska mime types. mpv can load them via file extension and they work as expected, so files using the new types should not trigger a warning from mpv.
* vf_buffer: remove this filterwm42017-12-124-94/+0
| | | | | It has been deprecated for a while and is 100% useless. It was forgotten in the recent filter purge. Get rid of it.
* options: don't report errors on help value for OPT_GEOMETRYpavelxdd2017-12-111-4/+11
| | | | The same idea as in 3723e61 but for OPT_GEOMETRY now.
* options: don't report errors on help value for OPT_COLORpavelxdd2017-12-111-6/+12
| | | | | The same idea as in 3723e61 but for OPT_COLOR now. Added missing closing bracket in the help message.
* options: don't report errors on help value for OPT_FLAGpavelxdd2017-12-111-4/+9
| | | | The same idea as in 3723e61 but for OPT_FLAG now.
* w32_common: update outdated comment about wakeup eventspavelxdd2017-12-111-2/+1
| | | | | mpv doesn't use WM_USER for wakeup events since 91079c0 Updated the comment.
* vf_convert: default to limited range when converting RGB to YUVwm42017-12-111-0/+5
| | | | | | | | | | Full range YUV causes problems everywhere. For example it's usually the wrong choice when using encoding mode, and libswscale sometimes messes up when converting to full range too. (In this partricular case, we found that converting rgba->yuv420p16 full range actually seems to output limited range.) This actually restores a similar heueristic from the late vf_scale.c.
* vo_gpu: hwdec_drmprime_drm: silence error on failed autoprobingwm42017-12-111-1/+1
| | | | | | | | | | When autoprobing the hwdec interops (which now happens to all compiled interops if hardware decoding is used), failure to load an interop should not print an error in the normal case. So hide it. (We could make the log level conditional on whether autoprobing is used, but directly loading it without autoprobing is obscure, and most other interops don't do this either.)
* hwdec: document a forgotten parameterwm42017-12-111-0/+1
| | | | Add the "all" value to the --gpu-hwdec-interop help output.
* video: remove code duplication by calling a hwdec loader helperwm42017-12-111-2/+1
| | | | | Make gl_video_load_hwdecs() call gl_video_load_hwdecs_all() when all HW decoders should be loaded.
* video: properly initialize and set hwdec_interopwm42017-12-111-0/+2
| | | | Don't reset --gpu-hwdec-interop if vo_gpu uses dumb mode.
* vd_lavc: always load VO interops with non-copy hw decoderswm42017-12-111-0/+4
| | | | | | | | For METHOD_INTERNAL hwdecs (non-copy cases), make sure the VO interops are always loaded, because those decoders will output hardware pixel formats, which will need special support in vo_gpu. Otherwise, initialization will fail, complaining that it can't convert the output format to something the VO supports.
* osd: fix a compiler warning by adding parentheses in if conditionpavelxdd2017-12-101-1/+3
|
* vo: fix a compiler warning by properly printing a 64bit integerJan Ekström2017-12-111-1/+1
|
* vd_lavc: add rkmpp to the hwdec_wrappers array.LongChair2017-12-101-0/+1
| | | | Allows to get the hwdec picked up properly by mpv on rockchip devices
* demux_timeline: disable pointless packet cache for sub-demuxerswm42017-12-103-8/+35
| | | | | | | | | | | | | | | | | It seems like there's nothing stopping from sub-demuxers from keeping packets in the cache, even if it's completely pointless. The top-most demuxer (demux_timeline) already takes care of caching, so sub-demuxers only waste space and time with this. Add a function that can disable the packet cache even at runtime and after packets are read. (It's not clear whether it really can happen that packets are read before demux_timeline gets the sub-demuxers, but there's no reason to make it too fragile.) Call it on all sub-demuxers. For this to work, it seems we have to move the code for setting the seekable_cache flag to before demux_timeline is potentially initialized, because otherwise the cache would be reenabled if the demuxer triggering timeline support is a timeline segment itself (e.g. ordered chapters).
* demux: fix accounting for seekable ranges on track switcheswm42017-12-101-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | This fixes missing audio when cycling through audio tracks with anything that uses nested demuxers, such as demux_timeline, which us used for EDL, --merge-files, ordered chapters, and youtube-dl pseudo DASH support. When this bug happened, reenabling an audio track would lead to silence for the duration of the readahead amount. The underlying reason is the incorrectly updated buffered range on track switch. It accidentally included the amount covered by the deselected stream. But the cause of the observed effect was that demux_timeline issued a refresh seek to the underlying slave demuxer, which in turn thought it could do a cache seek, because the seek range still included everything. update_stream_selection_state() calls update_seek_ranges() to update the seek ranges after a track switch. When reenabling the track, ds->eager was set to false during update_seek_ranges(), which made it think the stream was sparse, and thus it didn't restrict the current seek range (making later code think everything was buffered). Fix this by moving some code, so we first update the ds->eager flag, then the seek ranges. Also verbose log the low level stream selection calls.
* manpage: Fix typo (reomve -> remove)Anna-Maria Meriniemi2017-12-101-1/+1
| | | | This commit fixes the "reomve" typo in the Javascript docs.
* terminal-unix: fix race condition with tty resetDrew DeVault2017-12-091-10/+10
| | | | | | | | | | | | | Calling do_deactivate_getch2 before joining the terminal thread could lead to breakage if the terminal thread got another interation in before it was signaled to stop. This also addresses a minor error with the order in which things are initialized - getch2_poll would previously call tcgetpgrp(tty_in) before tty_in was initialized, which did not lead to broken behavior, but was not correct either. Fixes #5195
* terminal-unix: switch back to poll(3)Drew DeVault2017-12-091-15/+9
| | | | | This leverages the new polldev shim which lets us "poll" device files on macOS with select and use the genuine article on other platforms.
* osdep: add poll shim for macOSDrew DeVault2017-12-093-0/+83
| | | | | | | This implements a poll-compatible interface, backed by select on macOS, suitable for polling on device files - which are not supported by macOS's implementation of poll. This is a (long-standing) bug in macOS, so hopefully we can eventually remove this shim.
*