Commit Graph

42772 Commits

Author SHA1 Message Date
wm4 502763fcc7 video: slightly improve video stream switching
Resync newly switched video streams to the current playback position.
(Normal seeks will reset playback_pts to NOPTS.)
2016-01-26 14:06:41 +01:00
wm4 475d346174 vaapi: lower number of allocated surfaces again
Commit b53cb8de increased this by the number of additionally delayed
surfaces. But since this is only enabled in copy-back mode (which is
what process_image is about), the other additional surfaces accounted
for the direct rendering case can be ignored.
2016-01-26 14:05:54 +01:00
wm4 6462eabff3 manpage: fix typo 2016-01-25 22:35:16 +01:00
wm4 521110054d vo_opengl: add tscale-interpolates-only sub-option 2016-01-25 21:46:40 +01:00
wm4 bd1fb6f9b1 vo_opengl: default scaler-resizes-only sub-option to yes
Often requested. The main argument, that prominent scalers like sharpen
change the image even if no scaling happens, disappeared anyway.
("sharpen", unsharp masking, is neither prominent nor a scaler anymore.
This is an artifact from MPlayer, which fuses unsharp masking with
bilinear scaling in order to make it single-pass, or so.)
2016-01-25 21:46:40 +01:00
wm4 b53cb8de5e vd_lavc: delay images before reading them back
Facilitates hardware pipelining in particular with nvidia/dxva.
2016-01-25 21:46:40 +01:00
wm4 271cabe6a5 video: cleanup pts/dts passing between decoder components
Instead of using semi-public codec_pts/codec_dts fields in
struct dec_video, pass them via mp_image fields.
2016-01-25 21:46:39 +01:00
wm4 7f300b4204 vo_opengl: rename custom shader entrypoint from sample to sample_pixel
"sample" is a reserved identifier at least in GLES ES. Suggestions for a
better name than "sample_pixel" are still welcome.

Fixes #2733.
2016-01-25 20:24:41 +01:00
wm4 eaf2eebb50 vo_opengl: vdpau: better handling of preemption recovery
If recovery from preemption is done successfully, continue normally.
Only fail if it's preempted during init.
2016-01-25 19:40:35 +01:00
wm4 a160405284 vdpau: force driver to report preemption early
Another fix for the crazy and insane nvidia preemption behavior.

This time, the situation is that we are using vo_opengl with vdpau
interop, and that vdpau got preempted in the background while mpv was
sitting idly. This can be e.g. reproduced by using:

   --force-window=immediate --idle --hwdec=vdpau

and switching VTs. Then after switching back, load a video file.

This will not let mp_vdpau_handle_preemption() perform preemption
recovery, simply because it will do so only once vdp_decoder_create()
has been called. There are some other API calls which trigger
preemption, but many don't.

Due to the way the libavcodec API works, vdp_decoder_create() is way too
late. It does so when get_format returns. It notices creating the
decoder fails, and continues calling get_format without the vdpau
format. We could perhaps force it to reinit again (by adding a call to
vdpau.c, that checks for preemption, and sets hwdec_request_reinit), but
this seems too much of a mess.

Solve it by calling API in mp_vdpau_handle_preemption() that empirically
does trigger preemption: output_surface_put_bits_native(). This call is
useless, and in fact should be doing nothing (empty update VdpRect).
There's the slight chance that in theory it will slow down operation,
but in practice it's bound to be harmless. It's the likely cheapest and
simplest API call I've found that can trigger the fallback this way.
(The driver is closed source, so it was up to trial & error.)

Also, when initializing decoding, allow initial preemption recovery,
which is needed to pass the test mention above.
2016-01-25 16:45:18 +01:00
wm4 266d8368e8 audio: fix spdif PCM fallback
With the format left untouched, this would just try to reinit with a
spdif format again.

We're not clearing the format in reset_audio_state() so the audio chain
can be recreated any time without having to wait for a frame to be
decoded.
2016-01-25 13:43:43 +01:00
wm4 223588b36a audio: release pending audio frame on seeking 2016-01-25 13:41:28 +01:00
wm4 3a015b9ec7 video: remove some useless old RGB formats
Some VOs had support for these - remove them.

Typically, these formats will have only some use in cases where using
RGB software conversion with libswscale is faster than letting the
VO/GPU do it (i.e. almost never). For the sake of testing this case,
keep IMGFMT_RGB565. This is the least messy format, because it has no
padding/alpha bits with unknown semantics.

Note that decoding to these formats still works. We'll let libswscale
repack the data to whatever the VO in use can take.
2016-01-25 10:43:35 +01:00
Oliver Freyermuth 3c4f13c23a dvb: fix segmentation fault in case no valid configuration is found.
This was introduced in c55b242 .
2016-01-24 20:38:51 +01:00
wm4 d917efcd58 manpage: minor corrections
Pointed out by der_richter on IRC.
2016-01-24 19:41:32 +01:00
wm4 75d29b1457 video: limit maximum number of VO frames correctly
Otherwise, vo_frame.frames can be unintentionally overflown, leading to
undefined behavior in corner cases.
2016-01-24 18:09:14 +01:00
wm4 809786df42 DOCS/interface-changes: fix typo 2016-01-23 11:41:28 +01:00
wm4 7c991706c5 player: free queued audio frame on uninit 2016-01-23 11:41:19 +01:00
wm4 fae88b8113 manpage: adjust vf/af-command description 2016-01-22 21:20:23 +01:00
wm4 2e3a508387 af_lavfi, vf_lavfi: fix compilation on Libav
It has no avfilter_graph_send_command().
2016-01-22 20:53:52 +01:00
wm4 f176104ed5 command: add af-command command
Similar to vf-command. Requested. Untested.
2016-01-22 20:36:54 +01:00
wm4 4c25f49236 vo_opengl: vaapi: don't expect EGL exts. to be in common ext. string 2016-01-22 19:56:10 +01:00
wm4 135a7217b9 command: add vf-command command 2016-01-22 16:18:28 +01:00
Kevin Mitchell ce0b26c60f ao_wasapi: use correct UINT type for device enumeration
Notably, the address of the enumerator->count member is passed to
IMMDeviceCollection::GetCount(), which expects a UINT variable, not an int. How
did this ever work?
2016-01-22 03:21:21 -08:00
Kevin Mitchell ff7884e635 ao_wasapi: exit earlier if there are zero playback devices found
Previously, if the enumerator found no devices, attempting to get the default
device with IMMDeviceEnumerator::GetDefaultAudioEndpoint would result in the
cryptic (and undocumented) E_PROP_ID_UNSUPPORTED. This way, the user is given a
better indication of what exactly is wrong and isolates any other possible
triggers for this error.
2016-01-22 03:21:21 -08:00
wm4 2df448b1f3 dvb: remove trailing whitespace 2016-01-22 11:55:47 +01:00
wm4 ff4bd73fcb dvb: fix compilation with older Linux headers
At least DTV_ENUM_DELSYS is not available in older versions.

It's hard to tell when this identifier was introduced, but it appears it
was probably API version 5.5.
2016-01-22 11:54:37 +01:00
wm4 657dd4b807 video: don't wait for last video frame in the normal case
Even though the timing logic is correct, it tends to mess with looping
videos and such in unappreciated ways.

It also has to be admitted that most file formats seem not to properly
define the duration of the last video frame (or libavformat does not
export it in a useful way), so whether or not we should use the demuxer
reported framerate for the last frame is questionable. (Still, why would
you essentially just discard the last frame?)

The timing logic is kept, but disabled for video with "normal" FPS
values. In particular, we want to keep it for displaying images, which
implicitly set the frame duration to 1 second by reporting 1 FPS. It's
also good for slide shows with mf://.

Fixes #2745.
2016-01-22 00:25:44 +01:00
wm4 50c701574d sub: change when/how subtitles are read completely
Most text subtitles are read completely on loading (libavformat works
this way, and there are good reasons to do it on the higher levels too).
This leads to some messy problems. For example, the subtitle path is the
only one which might read packets during decoder initialization. This is
not neccessary; get rid of it.

This fixes a potential problem of seeking to position 0 for image
subtitles on init, and if the start position is not at the beginning of
the timeline.
2016-01-22 00:25:44 +01:00
wm4 04ec417d41 audio: refactor: move MPContext.ao_buffer field
It doesn't need to be part of the big context, but is strictly part of
shuffling data from the audio filters to audio output, and thus belongs
into ao_chain.

It also turns out that clearing it in clear_audio_output_buffers() is
completely redundant.

(Of course ao_buffer is an abomination in the first place and shouldn't
exist at all.)
2016-01-22 00:25:44 +01:00
wm4 536efe6faf player: fix some oversights in video refactoring
vo_chain_uninit() isn't supposed to care much about the decoder
(although decoders and outputs still go strictly together, so there is
not much of an actual difference now).

Also unset track.d_video correctly.

Remove a stale declaration from dec_video.h as well.
2016-01-22 00:25:44 +01:00
wm4 7bb9203f7f player: refactor: eliminate MPContext.d_audio 2016-01-22 00:25:44 +01:00
wm4 fef8b7984b audio: refactor: work towards unentangling audio decoding and filtering
Similar to the video path. dec_audio.c now handles decoding only. It
also looks very similar to dec_video.c, and actually contains some of
the rewritten code from it. (A further goal might be unifying the
decoders, I guess.)

High potential for regressions.
2016-01-22 00:25:44 +01:00
Michael Reed 27ecc417fe wscript: Update `--lua' help
This was outdated after a1f949d3b8.
2016-01-22 00:25:43 +01:00
wm4 03b50d4bf6 vo_opengl: vaapi: reorganize platform entrypoints as table 2016-01-21 13:32:29 +01:00
Oliver Freyermuth 9a2a0b0bba stream_dvb: add verbose output in non-DVBv5 querying.
May help in future debugging in case of old kernels
with modern / obscure devices.
2016-01-21 00:34:02 +01:00
Oliver Freyermuth b2a5c16a9d stream_dvb: use DVBv5 API also for DVB-C tuning.
Using the new API is a necessity for multiple-delivery-system
devices, since the old API does not offer a way to switch
the delivery system of the card.
This should in principle also be done for DVB-T / ATSC,
especially since most DVB-T devices also support DVB-C,
but I can not test such an implementation due to lack of hardware
(currently) so it seems better to leave the existing, tested code-path
in place for now.
2016-01-21 00:34:02 +01:00
Oliver Freyermuth 346cf7abf0 stream_dvb: improve messages on delivery-type detection.
No need use use all capital letters, and don't warn
if DVB-S2 is supported in addition since we handle that
in DVB-S case already.
Also, print the delivery system number for still unhandled
delivery systems to simplify debugging.
2016-01-21 00:34:02 +01:00
Oliver Freyermuth ab59c5f522 stream_dvb: don't requery tuner type, rely on initial query.
Saves one unnecessary additional ioctl per tuning
by just reusing existing information.
Should also fix the case of multiple supported delivery types
since we now rely on the initial query from the chosen
configuration after channel list parsing
instead of requerying the device.
2016-01-21 00:34:02 +01:00
Oliver Freyermuth e904129b79 stream_dvb: support frontends with multiple delivery systems.
Most common case would be DVB-C / DVB-T combination cards.
Cards with multiple delivery systems are only supported
starting from DVBv5 API (Kernel 2.6.38).
In this case, we loop over all delivery systems and
just treat them as different cards would be treated:
They all get their own TUNER-type, channel-list parsing etc.
2016-01-21 00:34:02 +01:00
Nils Schneider c406f83d37 x11: get *current* XRandR screen configuration
Only request the current screen configuration instead of polling for new
screens, too. We're not interested in detecting any new screens as we're
merely enumerating what is currently connected and configured.

On some hardware (like mine) calling XRRGetScreenResources will stall
X11 for about 10 to 20 seconds. This has annoyed me for a few months
now and almost made me switch to VLC ;)

Signed-off-by: wm4 <wm4@nowhere>
2016-01-20 20:28:16 +01:00
wm4 68366b05f2 vo_opengl: add KMS/DRM VAAPI hardware decoding interop
Just requires glueing it together with Bloat Super Glue (tm).
2016-01-20 19:41:29 +01:00
wm4 ca00e347fc ad_spdif: if DTS-HD is requested, and profile unknown, use DTS-HD
This means there will be no loss if profile detection failed for some
reason.
2016-01-20 17:18:28 +01:00
wm4 ac966ded11 audio: change downmix behavior, add --audio-normalize-downmix
This is probably the 3rd time the user-visible behavior changes. This
time, switch back because not normalizing seems to be the more expected
behavior from users.
2016-01-20 17:14:04 +01:00
wm4 930b0d1cf6 audio: change --audio-channels default back to stereo
Too many problems. Well, actually it's just Linux audio systems which
cause problems, and exclusive audio access on other platforms.

In any case, it seems you have to do some manual configuration if you
want multichannel audio output.
2016-01-20 17:12:08 +01:00
wm4 ff43215960 player: never show "DS: (unavailable)"
Kind of annoying.
2016-01-20 16:52:32 +01:00
wm4 f352669157 Change 3 more files to LGPL 2016-01-20 15:43:56 +01:00
wm4 a8abb53a5d vaapi: fix compilation on older FFmpeg/Libav
They don't define FF_PROFILE_VP9_0.

Fixes #2737.
2016-01-20 15:35:15 +01:00
wm4 aaafbfcc06 audio: remove initial decoding retry limitation
Seems useless.

This only helped in one case: one audio stream in the sample
av_find_best_stream_fails.ts had a AC3 packets which couldn't be
decoded, and for which avcodec_decode_audio4() returned 0 forever. In
this specific case, playback will now not start, and you have to
deselect audio manually.

(If someone complains, the old behavior might be restored, but
differently.)

Also remove the stale "bitrate" field.
2016-01-19 22:49:05 +01:00
wm4 30031edce3 audio: move direct packet reading from decoders to common code
Another bit of preparation.
2016-01-19 22:24:38 +01:00