aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
* demux_lavf: get total duration from per-track durations as fallbackGravatar wm42017-03-01
| | | | | | | | | Apparently fixes youtube mp4 streams if avformat_find_stream_info() is not called. Keeping audio/video track and other track durations separate is for the sake of embedded subtitle streams, where we want to include the duration of overlong subtitle streams (I think).
* vd_lavc: log pixel format requested from decoderGravatar wm42017-03-01
| | | | | | I find it slightly helpful in some situations. Also change the code to have a single exit path to make this easier.
* vf_vavpp: fix first-field modeGravatar wm42017-02-28
| | | | It didn't deinterlace at all. Oops.
* vf_vavpp: add advanced deint bug compatibility for Intel vaapi driversGravatar wm42017-02-28
| | | | | | | | | | | | | | | I'm not sure what's going on here, but it appears kodi switches forward and backwards references for advanced VPP deinterlacing modes. This in turn makes deinterlacing with these modes apparently work. If you don't switch the directions, you get a stuttering mess. As far as the libva trace dump is concerned, this makes mpv's libva deinterlacing API use behave like kodi's, and appears to reproduce smooth video with advanced libva deinterlacing enabled. I'm hearing that Mesa actually does it correctly, and I'm not sure what will happen there. For now, passing "reversal-bug=no" as sub-option to the vavpp filter will undo this behavior.
* vf_vavpp: minor fixesGravatar wm42017-02-28
| | | | | | | Fully initialize two structs (not doing so may or may not have been a bug). Actually destroy the VABufferID we create (moderate memory leak).
* cocoa: improve calculation of new window position on a different screenGravatar Akemi2017-02-28
| | | | | | | | | | | forcibly moving a window from one screen to another is supposed to put it in a position that looks relative the same as on the old screen, as in bottom, top, left and right margin look the same, without changing the window size. in some situations the old code moved the window off screen or on top of the menu bar so it ended up at a somewhat random position. the new code fixes some edge cases but is probably not completely correct since the priority is to make sure that the window ends up on the right screen.
* cocoa: only move window into screen bounds when changing screensGravatar Akemi2017-02-27
| | | | | | | | | | | when forcibly moving windows to a different screen with --screen or --fs-screen we need to move the window into the screen bounds if the window is out of bounds, otherwise it can end up on the wrong screen. previously it always recalculated the bounds and moved the window when toggling fullscreen, now it only does the bound calculation when changing screens. Fixes #4178
* cocoa: fix segfault in certain circumstancesGravatar Akemi2017-02-27
| | | | | | | | | | | | | | i falsely assumed that the windowDidChangeScreen was meant to report ‘physical’ screen changes but was wondering why it triggers on other events too. it actually is a event that informs us when anything referenced by our current NSScreen is changed. even when something referenced in the NSScreen changed the old and new NSScreen are still equal if the physical screen didn’t change. with that my previous optimisation broke some cases where the physical screen didn’t change but things it referenced did, leading to a segfault when theses were accessed. to keep the optimisation we will always update our internal NSScreen reference but the rest only when the physical screen was changed.
* osc: fix window dragging with showwindowed=noGravatar Akemi2017-02-27
| | | | | | | initialise OSC with a zero mouse area so mp_input_test_dragging returns a proper value. Fixes #1819
* cocoa: add option to force dedicated GPUGravatar Akemi2017-02-27
| | | | Fixes #3242
* osx: drop support for OS X 10.7 and earlierGravatar Akemi2017-02-27
|
* ao_alsa: close audio device if polling returns POLLERRGravatar wm42017-02-27
| | | | | | | | This is apparently what happens in this situation: Turn off display with DPMS, turn back on with DPMS. MPV is hung. See #4189.
* ao_alsa: fix an error checkGravatar wm42017-02-27
| | | | Fixes #4188 as pointed out in the issue.
* vo_opengl: hwdec_d3d11egl: make it work with some ANGLE DLL versionsGravatar wm42017-02-27
| | | | | | | | What a fucking waste of time. It depends on with which headers you compile as well, so the situation is worse and more confusing than you'd think. God knows what brain fart made them change the numeric ID without changing the extension name or any other ways to keep ABI-compatibility and without any warning.
* decode: fix extra surface countGravatar wm42017-02-27
| | | | | | | | | | | | FFmpeg could crash with vaapi (new) and --vo=opengl + interpolation. It seems the actual surface count the old vaapi code uses (and which usually never exceeded the preallocated amount) was higher than what was used for the new vaapi code, so just correct that. The d3d helpers also had weird code that bumped the real pool size, fix them as well. Why this would result in an assertion failure instead of a proper error, who knows.
* vf_vavpp: always limit forward/backward surfaces to requested numberGravatar wm42017-02-27
| | | | | | Don't give the driver more forward/backward refernces than it requested in num_forward_references/num_backward_references. This shouldn't matter, I'm just trying to play it safe.
* vf_vavpp: remove apparently broken change-detectionGravatar wm42017-02-27
| | | | | | This is probably wrong. Just don't bother with it. The only potentially negative effect is from calling vaQueryVideoProcPipelineCaps() every frame.
* vo_opengl: use misc/ctype.h instead of <ctype.h>Gravatar wm42017-02-25
| | | | | | Locale-independent, and doesn't have the char vs. unsigned char problem. (Although in this case, the code was fine, because bstr.start is unsigned char.)
* client: call certain external functions outside of client lockGravatar wm42017-02-24
| | | | | | | | | Fixes theoretical lock-order issues found by Coverity. Calling these inside the log is unnecessary anyway, because they have their own locking, and because mpv_detach_destroy() needs to be called by someone who has exclusive access to the mpv_handle (it's basically a destructor function). The lock order issues comes from the fact that they call back into the client API implementation to broadcast events and such.
* demux_lavf: skip avformat_find_stream_info() for some formatsGravatar wm42017-02-23
| | | | | | | | Includes hls, mp4, mkv by default. This also avoids stupid things like decoding at least 1 video frame per stream in the demuxer. This also add --demuxer-lavf-probe-info to give finer control over what happens.
* lavfi: temporary workaround for FFmpeg av_buffersrc_parameters_set() bugGravatar wm42017-02-22
| | | | | The function ignores AVBufferSrcParameters.channel_layout. Set it manually using the API.
* cocoa: fix dragging out of focus windowGravatar Akemi2017-02-21
| | | | | | | | | | fffab30 introduced a small regression where the cursor couldn't be unhidden after refocusing. the problem is that no mouseUp event was reported in our events_view. work around this with a separate event monitor. this also fixes another regression when the window is being dragged from the title bar. #4174
* player: don't block playback stop when seekingGravatar wm42017-02-21
| | | | | | This was added for A-B loops, but it looks like commit a1dec6f5 made this code unnecessary. Remove it, because it has the annoying side-effect of blocking playback stop when seeking past the end.
* player: fix stats-logging of sleep stateGravatar wm42017-02-21
|
* player: remove unnecessary wakeupGravatar wm42017-02-21
| | | | I can't find any actual need for it.
* vo: fix subtleties in the redrawing logicGravatar wm42017-02-21
| | | | | | | | | | | | | | | | | This fixes a race condition created by the previous commit, and possibly others. Sometimes interpolated frames weren't redrawn as uninterpolated ones. The problem is that redrawing/drawing a frame can't reset the VO want_redraw flags, because logically these have to happen after the core acknowledged and explicitly reissued a redraw. The core needs to be involved because the OSD text and drawings could depend on the playback or window state. Change it such that it always goes through the core. Also, VOs inconsistently called vo_wakeup() when setting want_redraw, which is also taken care of by this commit.
* player: reduce blocking on VO when switching pauseGravatar wm42017-02-21
| | | | | | | | | | | | | | | | | | | When pausing, we sent BOCTRL_PAUSE and VOCTRL_RESTORE_SCREENSAVER. These essentially wait until the video frame has been rendered. This is a problem with the opengl-cb, if GL rendering is done in the same thread as libmpv uses. Unfortunately, it's allowed to use opengl-cb this way. Logically speaking, it's a deadlock situation, which is resolved with a timeout. This can lead to quite ugly effects, like the on-pause frame not being rendered until the timeout has passed. It has been interpreted as video continuing to play. Resolve this by simply not blocking on pause. Make the screensaver controls async, and handle sending VOCTRL_PAUSE in the VO thread. (All this could be avoided by redoing the internal VO API.) Also see #4152.
* img_format: stop setting some fields to dummy values for hwaccel formatsGravatar wm42017-02-21
| | | | | Flags like MP_IMGFLAG_YUV were meaningless for hwaccel formats, and setting fields like component_bits made even less sense.
* mp_image: for hwaccel, use underlying fmt in mp_image_params_guess_csp()Gravatar wm42017-02-21
| | | | | | | | If imgfmt is a hwaccel format, hw_subfmt will contain the CPU equivalent of the data stored in the hw frames. Strictly speaking, not doing this was a bug, but since hwaccel formats were tagged with MP_IMGFLAG_YUV, it didn't have much of an impact.
* ao: never set ao->device = ""Gravatar Kevin Mitchell2017-02-20
| | | | | | | For example, previously, --audio-device='alsa/' would provide ao->device="" to the alsa driver in spite of the fact that this is an already parsed option. To avoid requiring a check of ao->device[0] in every driver, make sure this never happens.
* cocoa: only report mouse movements when window is not being draggedGravatar Akemi2017-02-20
| | | | | | even though the mouse doesn’t move relative to the window itself, when the window is being dragged, some outliers are still reported and trigger the OSC.
* cocoa: make window draggable on initGravatar Akemi2017-02-20
| | | | | | fixes the case when mpv is opened and the cursor is within the window bounds without moving the mouse. previously the window could only be dragged around after the first mouse movement.
* stream_cb: remove leftover doxygen lineGravatar wm42017-02-20
|
* vo_tct: check ioctl resultGravatar rr-2017-02-20
|
* image_writer: check a return valueGravatar wm42017-02-20
| | | | | Doesn't matter, since it's the flush call, but be nice. In particular, don't upset coverity.
* command: add a redundant NULL checkGravatar wm42017-02-20
| | | | | | | | | Currently, tracks have always associated streams, so there can't be a NULL dereference on the next line. But all the code is written with the possibility in mind that we might want tracks without streams, so make it consistent. Found by coverity.
* dec_video, dec_audio: remove redundant NULL-checksGravatar wm42017-02-20
| | | | OK, they're redundant. Now stop wasting my time, coverity.
* ao: fix potential NULL deref in ao_device_list_add()Gravatar wm42017-02-20
| | | | | | Probably didn't happen in practice, but anyway. Found by coverity.
* command: fix wrong sizeof() argumentGravatar wm42017-02-20
| | | | | | | Found by coverity. All of these cases happened to work, probably even in 32 bit (when the name pointer allowed it to use only 4 bytes of space).
* lavfi: support hwdec filters for --lavfi-complexGravatar wm42017-02-20
| | | | | | Not so important by itself, but important for when we replace the vf libavfilter wrapper with the common implementation. (Which will hopefully happen, but not too soon.)
* lavfi: use AVBufferSrcParametersGravatar wm42017-02-20
| | | | | It's nice that you don't have to create a parameter string anymore, but the rest sure is complicated as hell.
* lavfi: use mp_image to store the filter pad formatGravatar wm42017-02-20
| | | | | | | | | | Preparation for enabling hw filters. mp_image_params can't have an AVHWFramesContext reference (because it can't hold any allocations, and isn't meant to hold "active" data in the first place. So just use a mp_image. It has all real data removed, because that would essentially leak 1 frame once the decoder or renderer don't need it anymore.
* Fix two typosGravatar wm42017-02-20
| | | | They're unrelated. Sue me.
* wscript: drop pointless libavcodec vaapi.h/dxva2.h/d3d11va.h checksGravatar wm42017-02-20
| | | | | | Not needed under any circumstances. While the Windows ones export functions to which we must link, these functions are always available, even if libavcodec was compiled with D3D disabled.
* vd_lavc: increase verbosity if requested hwaccel is not compiledGravatar wm42017-02-20
| | | | | Well, not like we can detect whether it's missing from libavcodec, but it's still slightly better.
* vd_lavc, vaapi: move hw device creation to generic codeGravatar wm42017-02-20
| | | | | | | | hw_vaapi.c didn't do much interesting anymore. Other than the function to create a device for decoding with vaapi-copy, everything can be done by generic code. Other libavcodec hwaccels are planned to provide the same API as vaapi. It will be possible to drop the other hw_ files in the future. They will use this generic code instead.
* vo_opengl: remove dxva2 dummy hwdec backendGravatar wm42017-02-20
| | | | | | | | | This was a hack to let libmpv API users pass a d3d device to mpv. It's not needed anymore for 2 reasons: 1. ANGLE does not have this problem 2. Even native GL via nVidia (where this failed) seems to not require this anymore
* cocoa: fix cursor hiding at the top of the screen in fullscreenGravatar Akemi2017-02-19
| | | | | | | | | | | | | | | | | | | even before the recent refactor the cursor was hidden when moving it to the top of the screen in fullscreen and placing it on top of the now visible menu bar. we need to know when the menu bar is hidden so we don’t create a ‘dead zone’ at the top of the screen where the cursor can’t be hidden. to determine when the menu bar is visible, and with that the title bar, we get the height of the menu bar. the height is always 0 when hidden. furthermore there is no way to get the title bar directly and with that its height. so we calculate the frame rect of a NSWindowStyleMaskTitled window from a CGRectZero content frame. the resulting height is the height of a title bar. with that we can exclude the top area for the cursor hiding and can be certain when the menu bar is not hidden.
* cocoa: fix cursor hiding in the Dock area of the screenGravatar Akemi2017-02-19
| | | | | | | | | | | | | | | | the cursor couldn’t be hidden when the cursor was at the same position as the Dock, even if the cursor was next to it. this is especially annoying in fullscreen since the Dock isn’t actually hidden but is still reported as being visible. this basically made the part of the screen, where the Dock resides, a ‘dead zone’. so instead of using the visibleFrame we will just use the normal frame. there is no problem at the top area of the screen, since a window can’t be placed above the menu bar and in fullscreen the menu bar is always reported as not being on screen. i suspect this was done so the cursor wasn’t hidden when the it was placed above the Dock when windowed. with the recent refactor this is not needed any more.
* cocoa: simplify the cursor hiding codeGravatar Akemi2017-02-19
| | | | | | | | | | we can simplify the code because we don't need to change the bool pointer we were given by the VOCTRL_SET_CURSOR_VISIBILITY event. i assume this was done to work around some bugs previously to the recent cursor refactor. i kept that because i thought it was necessary, which wasn't in the end. after the refactor it only caused some weirdnesses i tried to work around. without it we can get rid of some special cases and simplify the code quite a bit.