summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* demux_mkv: fix incremental indexing with single-keyframe fileswm42015-11-171-2/+1
| | | | | | | | | | | | This is another regression of the recently added start time probing. If a seek is executed after opening the file (but before reading any packets), the first block is discarded instead of indexed. If there are no other keyframes in the file, seeking will fail completely. Fix it by seeking to the cluster start if there aren't any index entries yet. This will read the skipped packet again. Fixes #2498.
* videotoolbox: make decoder format customizablewm42015-11-179-13/+54
| | | | | | | | | | Because apparently there's no ideal universally working format. The weird OpenGL texture format for kCVPixelFormatType_32BGRA is from: http://stackoverflow.com/questions/22077544/draw-an-iosurface-to-an-opengl-context (Which apparently got it from the linked Apple example code.)
* vo_opengl: osx: error out if there is no IOSurfacewm42015-11-171-0/+4
|
* ao_openal: accommodate more sample formatsKevin Mitchell2015-11-171-7/+44
| | | | | | Try and and choose the closest sample format to the one requested. fixes #2494
* ao_openal: move uninit before initKevin Mitchell2015-11-171-12/+12
| | | | the next commit will use uninit within init
* player: remove OSD subtitle render pathwm42015-11-1710-127/+90
| | | | | | | | | | | | | | | | | | | This was used with --no-sub-ass (aka --no-ass). This option (which is not yet removed) strips all styling from the subtitles, and renders them as plaintext only. For some reason, it originally seemed convenient to reuse all the OSD text rendering code (osd_libass.c). While this was indeed simple, it had a bad influence on the rest of the code. For example, it had to decide whether to go through the OSD code path, or the proper subtitle renderer in sd_ass.c. Kill the OSD subtitle renderer. Reimplement --no-sub-ass and also "secondary" subtitles in sd_ass.c. fill_plaintext() contains some rather minor code duplication with osd_libass.c for setting up a dummy ASS_Event and escaping the stripped text. Since sd_ass.c already has to handle "normal" text subtitles, and has code for stripping ASS tags, this remains all relatively simple. Remove all the unnecessary crap from the rest of the code.
* player: use demuxer ts offset to simplify timeline ts handlingwm42015-11-1610-47/+16
| | | | | | | | | Use the demux_set_ts_offset() added in the previous commit to base each timeline segment to use timestamps according to its relative position within the overall timeline. As a consequence we don't need to care about these timestamps anymore, and everything becomes simpler. (Another minor but delicious nugget of sanity.)
* player: handle rebasing start time differentlywm42015-11-1613-44/+79
| | | | | | | | | | | | | | | | Most of this is explained in the DOCS additions. This gives us slightly more sanity, because there is less interaction between the various parts. The goal is getting rid of the video_offset entirely. The simplification extends to the user API. In particular, we don't need to fix missing parts in the API, such as the lack for a seek command that seeks relatively to the start time. All these things are now transparent. (If someone really wants to know the real timestamps/start time, new properties would have to be added.)
* vo_opengl: force dumb mode if RG textures are not availablewm42015-11-161-3/+3
| | | | | | | Something goes wrong somewhere. Don't bother, it's only needed for compatibility with our absolute baseline (GL 2.1/GLES 2). On the other hand, we can process nv12 formats just fine.
* README: suggest uchardet instead of Enca as dependencywm42015-11-161-1/+1
| | | | | Enca is dead, uchardet is better (in half of all cases; on others it's worse).
* sub: remove an unneeded old hack for MicroDVDwm42015-11-161-11/+0
| | | | This happens to be handled in a better way in another place now.
* vo_opengl: attempt to improve GLX vs. EGL backend detectionwm42015-11-163-37/+57
| | | | | | | | | | | | | | | For the sake of vaapi interop, we want to use EGL, but on the other hand, but because driver developers are full of shit, vdpau interop will not work on EGL (even if the driver supports EGL). The latter happens with both nvidia and AMD Mesa drivers. Additionally, EGL vaapi interop support can apparently only detected at runtime by actually using it. While hwdec_vaegl.c already does this, it would require initializing libva on _every_ system, which will cause libav to print an unpreventable bullshit message to the terminal. Try to counter these huge loads of bullshit by adding more fucking bullshit.
* vo_opengl: fix backend autoprobingwm42015-11-161-0/+9
| | | | | | | | | | | | | We want the following behavior: - VO probed, backend probed: only accept non-sw, fail completely otherwise - VO forced, backend probed: use the first non-sw, or if none is found, fall back to the first working sw backend - VO probed, backend forced: (I don't care about this case) - VO forced, backend forced: just use that backend Also, on backend probe failure the vo->probed field was left in its old state.
* win32: support taskbar button progress indicatorMartin Herkt2015-11-155-0/+67
| | | | | | | | | | | This adds support for the progress indicator taskbar extension that was introduced with Windows 7 and Windows Server 2008 R2. I don’t like this solution because it keeps its own state and introduces another VOCTRL, but I couldn’t come up with anything less messy. closes #2399
* vo_opengl: use glBlitFramebuffer to draw repeated frameswm42015-11-153-16/+27
| | | | | | | | | | | | | | | | | | | | | In the display-sync, non-interpolation case, and if the display refresh rate is higher than the video framerate, we duplicate display frames by rendering exactly the same screen again. The redrawing is cached with a FBO to speed up the repeat. Use glBlitFramebuffer() instead of another shader pass. It should be faster. For some reason, post-process was run again on each display refresh. Stop doing this, which should also be slightly faster. The only disadvantage is that temporal dithering will be run only once per video frame, but I can live with this. One aspect is messy: clearing the background is done at the start on the target framebuffer, so to avoid clearing twice and duplicating the code, only copy the part of the framebuffer that contains the rendered video. (Which also gets slightly messy - needs to compensate for coordinate system flipping.)
* vo: fix unpausing with display-syncwm42015-11-151-5/+3
| | | | | | | Currently, vo.c will always continue to render the currently queued frame, which sets last_flip, which in turn confuses vo_get_delay(), which in turn will show a bogus A/V desync message on unpause. So just reset it again on unpause.
* vo: fix dropping frames with display-syncwm42015-11-141-2/+0
| | | | | | I guess the removed code is an old leftover, and makes no sense anymore. Should fix weird A/V diff dropouts when frames are being dropped with display-sync.
* player: account for minor VO underrunswm42015-11-143-12/+18
| | | | | | | | | If the player sends a frame with duration==0 to the VO, it can trivially underrun. Don't panic, but keep the correct time. Also, returning the absolute time from vo_get_next_frame_start_time() just to turn it into a float with relative time was silly. Rename it and make it return what the caller needs.
* player: remove unused fieldwm42015-11-142-2/+0
|
* player: fix audio drift computation at different playback speedswm42015-11-141-8/+9
| | | | | This computed nonsense if the user set a playback speed other than 1 (in addition to the display-sync speed change).
* player: stricter framedrop thresholdwm42015-11-131-3/+2
| | | | | | 80ms allowable desync was a bit too much. It'd allow for a range of 160ms, which everyone can notice. It might also be a bother to apply compensation resampling speed for that long.
* player: try to compensate actual audio driftwm42015-11-132-0/+41
| | | | | | | | | | | | | | | | We always let audio slowly desync until a threshold is reached, and then pushed it back by applying a maximum compensation speed. Refine what comes afterwards: instead of playing with the nominal video speed, use the actual required audio speed for keeping sync as measured by the A/V difference. (The "actual" speed is the ideal speed with A/V differences added.) Although this works in theory, it's somewhat questionable how much this works in practice. The ideal time value is actually not exact, but is the time at which the frame is scheduled (could be compensated by using the time_left calculations in handle_display_sync_frame()). It doesn't account for speed changes or catastrophic discontinuities. It uses only 10 past frames.
* player: change display-sync audio speed only if neededwm42015-11-131-38/+48
| | | | | | | | | | As long as it's within the desync tolerance, do not change the audio speed at all for resampling. This reduces speed changes which might be caused by jittering timestamps and similar cases. (While in theory you could just not care and change speed every single frame, I'm afraid that such changes could possibly cause audio artifacts. So better just avoid it in the first place.)
* player: remove display_sync_disable_counterwm42015-11-132-11/+8
| | | | We can implement it differently and drop a tiny bit of state.
* command: add vsync-ratio propertywm42015-11-135-6/+42
| | | | | | | | This is very "illustrative", unlike the video-speed-correction property, and thus useful. It can also be used to observe scheduling errors, which are not detected by the core. (These happen due to rounding errors; possibly not evne our fault, but coming from files with rounded timestamps and so on.)
* player: compute required display-sync speed change differentlywm42015-11-131-22/+36
| | | | | | | | | | | | | Instead of looking at the current frame duration for the intended speedup, look at all past frames, and find a good average speed. This ties in with not wanting to average _all_ frame durations, which doesn't make sense in VFR situations. This is currently done in the most naive way possible, but already sort of works for VFR which switches between frame durations that are integer multiples of a base rate. Certainly more improvements could be made, such as trying to adjust directly on FPS changes, instead of averaging everything, but for now this is not needed at all.
* player: smooth out frame durations by averaging themwm42015-11-131-1/+1
| | | | | | | | | | | | | | | | | | Helps somewhat with muxer-rounded timestamps. There is some danger that this introduces a timestamp drift. But since they are averaged values (unlike as when using an incorrect container framerate hint), any potential drift shouldn't be too brutal, or compensate itself soon. So I won't bother yet with comparing the results with the real timestamp, unless we run into actual problems. Of course we still prefer potentially real timestamps over the approximated ones. But unless the timestamps match the container FPS, we can't know whether they are (no, checking whether the they have microsecond components would be cheating). Perhaps in future, we could let the demuxer export the timebase - if the timebase is not 1000 (or divisible by it), we know that millisecond-rounded timestamps won't happen.
* player: refactor display-sync frame duration calculationswm42015-11-135-134/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | Get rid of get_past_frame_durations(), which was a bit too messy. Add a past_frames array, which contains the same information in a more reasonable way. This also means that we can get the exact current and past frame durations without going through awful stuff. (The main problem is that vo_pts_history contains future frames as well, which is needed for frame backstepping etc., but gets in the way here.) Also disable the automatic disabling of display-sync if the frame duration changes, and extend the frame durations allowed for display sync. To allow arbitrarily high durations, vo.c needs to be changed to pause and potentially redraw OSD while showing a single frame, so they're still limited. In an attempt to deal with VFR, calculate the overall speed using the average FPS. The frame scheduling itself does not use the average FPS, but the duration of the current frame. This does not work too well, but provides a good base for further improvements. Where this commit actually helps a lot is dealing with rounded timestamps, e.g. if the container framerate is wrong or unknown, or if the muxer wrote incorrectly rounded timestamps. While the rounding errors apparently can't be get rid of completely in the general case, this is still much better than e.g. disabling display-sync completely just because some frame durations go out of bounds.
* player: always require a future frame with display-sync enabledwm42015-11-131-2/+6
| | | | | | We need a frame duration even on start, because the number of vsyncs the frame is shown is predetermined. (vo_opengl actually makes use of this property in certain cases.)
* command: rename vo-missed-frame-count propertywm42015-11-136-25/+22
| | | | | | | | | "Missed" implies the frame was dropped, but what really happens is that the following frame will be shown later than intended (due to the current frame skipping a vsync). (As of this commit, this property is still inactive and always returns 0. See git blame for details.)
* win32: avoid detection as exclusive fullscreen windowMartin Herkt2015-11-132-1/+5
| | | | | | | | | | | | | | | | | Apparently Windows treats windows that use OpenGL, cover an entire screen and have the WS_POPUP style set or are topmost windows as exclusive fullscreen windows that bypass DWM and cannot be covered by other windows. This means we can’t use dwmflush in fullscreen mode, and it also means that no other window can cover mpv, and it makes the screen flicker when switching to fullscreen mode. This can be avoided by not setting the WS_POPUP flag. Users can still access the old behavior by enabling stay-on-top (which IMO at least makes sense—now we just need to get dwmflush autodetection right to avoid nasty surprises). fixes #2177
* vo_opengl_cb: do not block on flipping when redrawingwm42015-11-121-0/+5
| | | | | Gives slightly better behavior when used with Qt. (Which tends not to flip buffers when the window is not visible.)
* build: make vaapi-wayland depend on gl-waylandwm42015-11-121-1/+1
| | | | | | | Wayland without GL isn't enough. Specifically, we need to make sure the EGL libs are included. (That's one tricky dependency tree.) Fixes #2476.
* demux_libass: remove this demuxerwm42015-11-116-138/+1
| | | | | | | | | This loaded external .ass files via libass. libavformat's .ass reader is now good enough, so use that instead. Apparently libavformat still doesn't support fonts embedded into text .ass files, but support for this has been accidentally broken in mpv for a while anyway. (And only 1 person complained.)
* demux_lavf: mark ASS tracks as always UTF-8wm42015-11-111-0/+4
| | | | | Stops mpv from trying to run a subtitle charset detector on .ass files loaded by libavformat.
* player: less naive roundingwm42015-11-111-1/+1
|
* drm: fix setting up connectorsrr-2015-11-111-1/+1
| | | | Fixes regression from 67caea357c23443cf583ad401a38bbaae19e3df8.
* af_lavrresample: simplify set_compensation usagewm42015-11-111-13/+12
| | | | | | | | | | | | | Just set the ratio directly by working around the intended semantics of the API function. The silly rounding stuff we had isn't needed anymore (and not entirely correct anyway). Note that since the compensation is virtually active forever, we need to reset if it's not needed. So always run this code to be sure to reset it. Also note that libswresample itself had a precision issue, until it was fixed in FFmpeg commit 351e625d.
* player: silence sporadic error messages on audio initwm42015-11-101-1/+1
| | | | | | | | | | | | When the audio format is not known yet and the audio chain is still initializing, filter reinit will fail. Normally, attempts to reinitialize filters at this stage should be rare (e.g. user commands editing the filter chain). But it sometimes happened with track switching in combination with the video code calling update_playback_speed() at arbitrary times. Get rid of the message by not trying to change the filters for the sake of playback speed update while decoding is still being initialized.
* vd_lavc: be more careful with flushing the decoderwm42015-11-102-5/+22
| | | | | | | | | | | | | | | | | Until now, we've relied on the following things: - you can send flush packets to the decoder even if it's fully flushed, - you can send new packets to a flushed decoder, - you can send new packers to a partially flushed decoder. ("flushing" refers to sending flush packets to the decoder until the decoder does not return new pictures, not avcodec_flush_buffers().) All of these are questionable. The libavcodec API probably doesn't guarantee that these work well or at all, even though most decoders have no issue with these. But especially with hardware decoding wrappers (like MMAL), real problems can be expected. Isolate us from these corner cases by handling them explicitly.
* vo_opengl: move the glFlush() call to the rendererwm42015-11-102-5/+5
|
* vo_opengl_cb: better underflow reportingwm42015-11-101-6/+12
| | | | | | | This applies to unexpected freezes or deadlocks, not e.g. normal framedrops. The verbose messages also might remind an API user if the API usage is incorrect, such as not calling mpv_opengl_cb_draw() when a redraw request was issued.
* vo_opengl: limit GLSL to version 3.3wm42015-11-101-0/+2
| | | | | Fixes custom shaders, which define their entrypoint as sample() function.
* stream_libarchive: make libarchive seek callback lazyKevin Mitchell2015-11-091-3/+22
| | | | This fixes problems seeking http streams to their end.
* stream_libarchive: add multivolume supportKevin Mitchell2015-11-092-16/+156
| | | | | | | | | | | | | | This commit introduces logic to read other volumes from the same source as the primary archive. Both .rar formats as well as 7z are supported for now. It also changes the libarchive callback structure to be per-volume consistent with the libarchive intenal client data array constructed with archive_read_append_callback_data. Added open, close and switch callbacks. Only the latter is strictly required to make sure that the streams always start at position 0, but leaving all volumes open can eat a lot of memory for archives with many parts.
* libarchive: remove redundant log prefixKevin Mitchell2015-11-092-4/+4
| | | | "libarchive:" is already added by the logging system
* external_files: deduplicate bstr functionsKevin Mitchell2015-11-091-20/+4
|
* vo_opengl: fix 10-bit video prescalingBin Jin2015-11-095-24/+21
| | | | | | | | | | | The nnedi3 prescaler requires a normalized range to work properly, but the original implementation did the range normalization after the first step of the first pass. This could lead to severe quality degradation when debanding is not enabled for NNEDI3. Fix this issue by passing `tex_mul` into the shader code. Fixes #2464
* vo_opengl_cb: make operation more similar to normal VOswm42015-11-094-140/+61
| | | | | | | | | | | | | | | | | | | | | vo_opengl_cb is a special case, because we somehow have to render video asynchronously, all while "trusting" the API user to do it correctly. This didn't quite work, and a while ago a compromise using a timeout to prevent theoretically possible deadlocks was added. Make it even more synchronous. Basically, go all the way, and synchronize rendering between VO and user renderer thread to the full extent possible. This means the silly frame queue is dropped, and we event attempt to synchronize the GL SwapBuffer call (via mpv_opengl_cb_report_flip()). The changes introduced with commit dc33eb56 are effectively dropped. I don't even remember if they mattered. In the future, we might make all VOs fetch asynchronously from a frame queue, which would mostly remove the differences between vo_opengl and vo_opengl_cb, but this will take a while (if it will even be done).
* vo_opengl: handle GL_ARB_uniform_buffer_object with low GLSL versionswm42015-11-095-6/+19
| | | | Why is this stupid crap being so much a pain for no reason.
* vo_opengl: fix extension namewm42015-11-091-1/+1
|
* vo_opengl: simplify GLSL version detectionwm42015-11-091-10/+4
| | | | | | | | | | | Pick the correct GLSL version from the GL_SHADING_LANGUAGE_VERSION string. Might be somewhat questionable, as we expect the minor version number not to have leading 0s. Should help with cases when the reported GLSL version is much higher than the equivalent of the reported GL version. This problem was observed in combination with GL_ARB_uniform_buffer_object, which can't be used if the declared GLSL version is too low.
* command: make display-fps property writablewm42015-11-092-8/+10
| | | | | | | Has the same function as setting the option. This commit changes the property in a bunch of other ways. For example if the VO is not created, it will return the option value.
* vo_opengl: never load vaapi GLX interop by defaultwm42015-11-095-8/+8
| | | | | | | Causes more harm than it helps. Will eventually be removed. Also rename the "reject_emulated" field to "probing" - this is more appropriate now.
* vo_opengl: always preload hwdec interopwm42015-11-091-3/+6
| | | | | | | | | Simplifies some auto detection matters. I _still_ don't want to remove the lazy loading mechanism, because it's still slightly useful for filters using the hwdec APIs. My main motivation for not always preloading them is actually that libva prints random useless crap to the terminal with no way to prevent this.
* vo_opengl: rename "drm_egl" to "drm-egl"wm42015-11-092-3/+3
|
* vo_opengl: disable drm_egl autopickuprr-2015-11-091-0/+4
|
* dec_audio: add missing includewm42015-11-081-0/+1
| | | | Was masked by FFmpeg's terrible headers, but failed with Libav.
*