summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* demux_timeline: slightly improve reported file formatwm42016-02-251-1/+3
| | | | | Report the underlying demuxer's format. Since there can be many demuxers participating, pick the "main" segment.
* player: slightly simplify how demuxer streams are enabled/disabledwm42016-02-255-42/+31
| | | | | Instead of having reselect_demux_streams() look at all streams, make it look at the current stream that is being enabled/disabled.
* player: fix --force-window behaviorwm42016-02-251-2/+2
| | | | | | | | | | | | | | | | | _Of course_ the previous commit broke --force-window behavior (like it does every single time I touch it). vo_has_frame() gets cleared after a seek, so e.g. stopping playback of a file and going to the next by keeping the seek key down will enter a short moment without video at the end of the first file, which will set the stalled_video variable to true. Prevent it by using the indication whether the window was properly created (which is probably exactly what we want here). This function is also responsible for destroying the window when needed, and obviously we should never do that while video is active. (This is the actual bug, although the other change in this commit already hides the common breakage it caused.)
* player: honor --force-window if video is selected, but inactivewm42016-02-241-4/+10
| | | | | If a video track is selected, but no video is decoded from it (mostly with broken files), then create the window anyway.
* demux: avoid lost wakeup on queue overflowwm42016-02-241-1/+6
| | | | | | | | | If a stream is marked as EOF (due to no packets found in reach), then we need to wakeup the decoder. This is important especially if no packets are found at the start of the file, so the A/V sync logic actually starts playback, instead of waiting for packets that will never come. (It would randomly start playback when running the playback loop due to arbitrary external events like user input.)
* demux_mkv: don't trust DefaultDuration for audiowm42016-02-241-5/+3
| | | | | It's used to interpolate timestamps for sub-packets ("block laces"). It's occasionally broken, and not really needed by us.
* vo_opengl, vo_rpi: unbreak a few thingswm42016-02-243-4/+4
| | | | | Commit 2f562825 didn't remove the "color" declaration for these. Since the shader header already declares it, shader compilation broke.
* player: remove pointless callwm42016-02-231-1/+0
| | | | | This is the unfortunate video timer; it's already reset when it actually matters (after video was prepared and before video is actually started).
* player: simplify enabling demuxer threadswm42016-02-231-17/+6
| | | | | No need for this crazy loop anymore, and we can simply enable it for each demuxer when it's opened.
* player: remove unused MPContext.stream fieldwm42016-02-233-11/+1
| | | | | | | It was just dead code. Also fixes the stream-open-filename property, which is supposed to be read-only if a file was already opened.
* player: remove MPContext.sources fieldswm42016-02-232-17/+4
| | | | | | Some oddity that is not needed anymore. The only thing which still referenced them was avoiding loading external files more than once, which is now prevented by checking the list of tracks instead.
* vo_opengl: declare vec4 color inside fragment shader stubNiklas Haas2016-02-233-43/+27
| | | | | | Why was this done so stupidly, with so many complicated special cases, before? Declare it once so the shader bits don't have to figure out where and when to do so themselves.
* vo_opengl: set uniform variable "pixel_size"igv2016-02-221-0/+2
| | | | | pixel_size is often used variable, also reciprocal is a costly operation for AMD and older nVidia (prior to Kepler) GPUs.
* vo_opengl: set the correct size of the input imageigv2016-02-221-2/+2
|
* vo_x11: add 16bpp supportGusar3212016-02-221-0/+1
|
* wscript: don’t install the encoding profiles with encoding disabledEmmanuel Gil Peyrot2016-02-221-1/+2
|
* demux_mkv: fix opus gapless behavior (2)wm42016-02-221-2/+2
| | | | | | | Commit 943f76e6, which already tried this, was very stupid: it didn't actually override the samplerate for Opus, but overrode it for all codecs other than Opus. And even then, it failed to use the overridden samplerate. (Sigh...)
* demux_lavf: adjust seeks by maximum codec delaywm42016-02-221-0/+8
| | | | | | | | | | | | | | | Fixes relative seeks. Without this, a seek back could skip so much data that the seek would effectively jump forward. (Or insert silence for files with video.) There's the question whether the frontend should do this instead (by using information from the decoders), but for now this seems more proper. demux_mkv.c does this already, sort of. libavformat doesn't for seeks in .ogg (aka .opus), but might be doing it for mkv. Seems to be a mess as well.
* audio: make mp_audio_skip_samples() adjust the PTSwm42016-02-222-3/+3
| | | | Slight simplification/cleanup.
* ad_lavc: skip AVCodecContext.delay samples at beginningwm42016-02-221-0/+9
| | | | | | | | Fixes correctness_trimming_nobeeps.opus. One nasty thing is that this mechanism interferes with the container-signalled mechanism with AV_FRAME_DATA_SKIP_SAMPLES. So apply it only if that is apparently not present. It's a mess, and it's still broken in FFmpeg CLI, so I'm sure this will get fucked up later again.
* ad_lavc: make sample trimming symmetric to skippingwm42016-02-221-6/+8
| | | | | | I'm not quite sure what the FFmpeg AV_FRAME_DATA_SKIP_SAMPLES API demands here. The code so far assumed that skipping can be more than a frame, but not trimming. Extend it to trimming too.
* ad_lavc: move skipping logic out of the HAVE_AVFRAME_SKIP_SAMPLES blockwm42016-02-221-10/+13
|
* ad_lavc: interpolate missing timestampswm42016-02-221-0/+9
| | | | | | | | | | This is actually already done by dec_audio.c. But if AV_FRAME_DATA_SKIP_SAMPLES is applied, this happens too late here. The problem is that this will slice off samples, and make it impossible for later code to reconstruct the timestamp properly. Missing timestamps can still happen with some demuxers, e.g. demux_mkv.c with Opus tracks. (Although libavformat interpolates these itself.)
* audio: move frame clipping to a generic functionwm42016-02-213-33/+37
|
* demux_mkv: add hack to fix opus gapless behaviorwm42016-02-211-0/+6
| | | | | | | I think the conclusion is that AV_PKT_DATA_SKIP_SAMPLES is misdesigned (at least for some formats), and an alternative mechanism using durations would be better. (Combining it with a proper timebase would keep sample-accuracy.)
* manpage: fix typowm42016-02-211-1/+1
|
* manpage: add hint where the full keybindings are declaredwm42016-02-211-0/+4
| | | | The actual location of input.conf the user has to find out himself.
* sub: always clip subtitles against segment endwm42016-02-201-1/+5
| | | | | | | | | | | | This happens only if the new segment wasn't read yet. This is not quite proper and a problem with dec_sub.c internals. Ideally, it'd wait with rendering until a new enough segment has been read. Normally, the new segment is available immediately, so the end will be automatically clipped by switching to the right segment in the exact moment it's supposed to become effective. Usually shouldn't cause any problems, though.
* demux_timeline: fix nested timelineswm42016-02-204-6/+7
| | | | | You can e.g. reference ordered chapters or other EDL files in EDLs. There were some bugs left which broke this in some cases.
* vd_lavc: simplify hwdec pixfmt checkwm42016-02-201-1/+1
| | | | | Instead of checking whether the format is a hwaccel format, check whether it's the exact format we've requested for hardware decoding.
* dxva2: fix autoprobingwm42016-02-191-1/+6
| | | | | | | | | | | Doing --hwdec=auto ends up picking dxva2, creating a decoder, and then sending D3D frames down the video chain, which immediately fails and falls back to software. Consider dxva2 only if the VO provides a context. If this fails, autoprobing will proceed to try dxva2-copy as usual. Fixes #2844.
* video: allow the decoder to consume packets partiallywm42016-02-192-2/+9
| | | | | | | | | | | | | | | | | | | | This is in preparation for a hypothetical API change in libavcodec, which would allow the decoder to return multiple video frames before accepting a new input packet. In theory, the body of the if() added to vd_lavc.c could be replaced with this code: packet->buffer += ret; packet->len -= ret; but currently this is not needed, as libavformat already outputs one frame per packet. Also, using libavcodec this way could lead to a "deadlock" if the decoder refuses to consume e.g. garbage padding, so enabling this now would introduce bugs. (Adding this now for easier testing, and for symmetry with the audio code.)
* video: move packet timestamp fudgingwm42016-02-191-9/+8
| | | | | | | | | | There is some strange code which sets the DTS of the packet to PTS (but only if it's not AVI), which apparently helps with timestamp determination with some broken files. This code is annoying because it tries to avoid mutating the packet (which it logically doesn't own). Move it to where it does and get rid of the packet_copy mess. Needed for the following commit.
* video: move unreliable-packet-PTS checkwm42016-02-191-5/+8
| | | | | | | This tries to determine whether packet PTS values are accurate and can be used for frame dropping during seeking. Move both checks (PTS is missing; PTs is non-monotonic) to the earliest place where they can be done.
* player: remove initial seek on playback startwm42016-02-181-2/+0
| | | | | | Accidental leftover from commit ae55896f. (This seek ised to be done with ordered chapters, and was accidentally changed to always being done.)
* dxva2: fix shared surface typeJames Ross-Gowan2016-02-191-22/+22
| | | | | | | | | | | The WGL_NV_DX_interop spec says that a shared IDirect3DSurface9 must not be lockable, but off-screen plain surfaces are always lockable and using them causes Nvidia drivers to crash. Use a rendertarget for the shared surface instead. This also changes the name of the DX_interop handle for the rendertarget to match the name of the DirectX object (rather than the GL one) to match the convention used in context_dxinterop.c.
* glob-win: relicense to LGPLJames Ross-Gowan2016-02-181-7/+7
| | | | | | This file was rewritten from scratch in 0cef033, so it should be okay. As mentioned in #730, it's a complete rewrite referencing only MSDN and POSIX, rather than the original code.
* vo_opengl: use correct gl_target variablewm42016-02-181-2/+2
| | | | | p->gl_target and plane->gl_target are always the same value here, but semantically plane->gl_target is the correct one.
* vo_opengl: don't use normalized coords for debanding rectangle textureswm42016-02-181-1/+2
| | | | Fixes #2831.
* vo_opengl: pass the correct target to deband functionswm42016-02-181-4/+4
| | | | | | | | Apple crap (namely hardware decoding interop) forces us to use rectangle textures for input. But after that we continue with normal textures. This was not considered for debanding, and the sampler type used for it can be different depending on the exact render chain. Simply use the target type of the input texture.
* wscript: remove dxva2-dxinterop configure testKevin Mitchell2016-02-173-8/+3
| | | | Wasn't really necessary as it was equivalent to gl-dxinterop.
* vo_opengl: dxinterop: add dxva2 passthroughKevin Mitchell2016-02-175-0/+235
| | | | | Use dxva2 surface to fill RGB IDirect3DSurface9 shared with opengl via DXRegisterObjectNV.
* dxva2: add interop (non-copyback) hwdec_typeKevin Mitchell2016-02-174-4/+20
| | | | | This always falls back to software decoding right now. VO support will be added in future commits.
* vo_opengl: dxinterop: improve error messagesKevin Mitchell2016-02-171-21/+37
| | | | | | | * use mp_HRESULT_to_str/mp_LastError_to_str * make some messages non-identical * replace "GL" -> "OpenGL" * change some MP_FATAL to MP_ERR that don't actually kill the vo
* windows_utils: try and use FormatMessage for errors.Kevin Mitchell2016-02-172-3/+23
| | | | | | This is useful in particular for GetLastError, unfortunately, it's stil pretty dumb with regards to WASAPI or D3D specific errors, so keep the hresult_to_string switch.
* dxva2: avoid using AV_PIX_FMT_P010 directlywm42016-02-171-3/+4
| | | | | | | The new code is essentially equivalent, but compiles against older ffmpeg. Fixes #2832.
* dxva2: use mp_HESULT_to_str on FAILED(hr)Kevin Mitchell2016-02-162-11/+55
|
* dxva2: use mp_image_pool_get_no_alloc for decoder imagesKevin Mitchell2016-02-161-1/+2
| | | | | This makes it more explicit that the pool doesn't ever actually do any allocating itself.
* dxva2: check for failure of mp_image_new_custom_refKevin Mitchell2016-02-161-5/+8
| | | | previously, this may have caused a leak
* dxva2: another attempt at using mp_image poolKevin Mitchell2016-02-163-81/+46
| | | | | | | | | | Apparently, some drivers require you to allocate all of the decoder d3d surfaces at once. This commit changes the strategy from allocating surfaces as needed via mp_image_pool_set_allocator, to allocating all the surfaces in one call to IDirectXVideoDecoderService_CreateSurface and adding them to the pool with mp_image_pool_add. fixes #2822
* mp_image_pool: add mp_image_pool_addKevin Mitchell2016-02-162-4/+11
| | | | | | Provide a way for the user to add mp_images to the pool. This is required for dxva2, for which using set_allocator is extremely awkward since all the d3d9 surfaces must be allocated in advance and all together.
* dxva2: fix license on some newly added files to lgpl v2.1+Kevin Mitchell2016-02-162-14/+14
| | | | | | I mistakenly copied the wrong license text into these files when I created them. Since I'm the only one to have touched these files, it should be OK to change them.
* demux_timeline: cosmetics: move a functionwm42016-02-161-26/+24
| | | | Gets rid of a forward declaration.
* demux_timeline: disable cache for inactive segmentswm42016-02-161-0/+8
| | | | | | | | This is achieved indirectly by deslecting all streams for the non- current segment (and if the segment doesn't share the demuxer with the currently active one). Restores functionality added with commit 46bcdb70.
* Rewrite ordered chapters and timeline stuffwm42016-02-1511-12/+618
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses a different method to piece segments together. The old approach basically changes to a new file (with a new start offset) any time a segment ends. This meant waiting for audio/video end on segment end, and then changing to the new segment all at once. It had a very weird impact on the playback core, and some things (like truly gapless segment transitions, or frame backstepping) just didn't work. The new approach adds the demux_timeline pseudo-demuxer, which presents an uniform packet stream from the many segments. This is pretty similar to how ordered chapters are implemented everywhere else. It also reminds of the FFmpeg concat pseudo-demuxer. The "pure" version of this approach doesn't work though. Segments can actually have different codec configurations (different extradata), and subtitles are most likely broken too. (Subtitles have multiple corner cases which break the pure stream-concatenation approach completely.) To counter this, we do two things: - Reinit the decoder with each segment. We go as far as allowing concatenating files with completely different codecs for the sake of EDL (which also uses the timeline infrastructure). A "lighter" approach would try to make use of decoder mechanism to update e.g. the extradata, but that seems fragile. - Clip decoded data to segment boundaries. This is equivalent to normal playback core mechanisms like hr-seek, but now the playback core doesn't need to care about these things. These two mechanisms are equivalent to what happened in the old implementation, except they don't happen in the playback core anymore. In other words, the playback core is completely relieved from timeline implementation details. (Which honestly is exactly what I'm trying to do here. I don't think ordered chapter behavior deserves improvement, even if it's bad - but I want to get it out from the playback core.) There is code duplication between audio and video decoder common code. This is awful and could be shareable - but this will happen later. Note that the audio path has some code to clip audio frames for the purpose of codec preroll/gapless handling, but it's not shared as sharing it would cause more pain than it would help.
* player: remove old timeline/ordered chapters supportwm42016-02-155-277/+51
|
* packet: cosmetics: reorder fieldswm42016-02-151-4/+8
|
* audio/video: expose codec info as separate fieldwm42016-02-158-14/+16
| | | | | Preparation for the timeline rewrite. The codec will be able to change, the stream header not.
* video: remove pointless parameter indirectionwm42016-02-153-4/+6
| | | | This is always the same value.
* sub: move sub decoder init to a functionwm42016-02-151-30/+44
| | | | Preparation for timeline rewrite.
* cocoa: fix charcode retrieving for accented charactersAlexis Nootens2016-02-151-1/+2
| | | | | The handler was retrieving an invalid charcode for accented characters, thus ignoring them.
* player: add on_preloaded hookwm42016-02-152-0/+27
| | | | (Limited usefulness.)
* player: restore old/correct --force-window behaviorwm42016-02-151-0/+3
| | | | | | | | | When playback of a video ends, and the next file has no video at all (no cover art or anything), then the window must be cleared. This also resizes the window forcibly, which is by design. Fixes #2825.
* vo_opengl_cb: unbreak destroying+recreating GL contextwm42016-02-151-2/+2
| | | | | | A client API user is allowed to call mpv_opengl_cb_uninit_gl() followed by mpv_opengl_cb_init_gl(). This crashed; fix it by fixing the lifetime of ctx->gl.
* dxva2: support HEVC Main 10wm42016-02-151-8/+35
|
* dxva2: use mp_image pool for d3d surfacesKevin Mitchell2016-02-144-131/+222
| | | | | | | | | | | | | This is required so that the individual surfaces can pass beyond the dxva2 decoder and be passed to the vo. This also adds additional data to mp_image->planes[0] for IMGFMT_DXVA2, which is required for maintaining and releasing the surface even if the decoder code is uninited. The IDirectXVideoDecoder itself is encapsulated together with its surface pool and configuration in a dxva2_decoder structure whose creation and destruction is managed by talloc.
* dxva2: remove unused structure membersKevin Mitchell2016-02-141-5/+1
|
* dxva2: streamline number of surface calculationKevin Mitchell2016-02-141-9/+2
| | | | | use hwdec_get_max_refs and put the "4 base work surfaces" into ADDITIONAL_SURFACES macro.
* client API: explain when mpv_create() can return NULLwm42016-02-141-1/+4
|
* demux_mkv: support channel layout in VfW muxed PCMwm42016-02-141-1/+7
| | | |