Commit Graph

41372 Commits

Author SHA1 Message Date
wm4 a2eb0ab076 vd_lavc: make hardware decoding fallback less violent
Most of hardware decoding is initialized lazily. When the first packet
is parsed, libavcodec will call get_format() to check whether hw or sw
decoding is wanted. Until now, we've returned AV_PIX_FMT_NONE from
get_format() if hw decoder initialization failed. This caused the
avcodec_decode_video2() call to fail, which in turn let us trigger the
fallback. We didn't return a sw format from get_format(), because we
didn't want to continue decoding at all. (The reason being that full
reinitialization is more robust when continuing sw decoding.)

This has some disadvantages. libavcodec vomited some unwanted error
messages. Sometimes the failures are more severe, like it happened with
HEVC. In this case, the error code path simply acted up in a way that
was extremely inconvenient (and had to be fixed by myself). In general,
libavcodec is not designed to fallback this way.

Make it a bit less violent from the API usage point of view. Return a sw
format if hw decoder initialization fails. In this case, we let
get_buffer2() call avcodec_default_get_buffer2() as well. libavcodec is
allowed to perform its own sw fallback. But once the decode function
returns, we do the full reinitialization we wanted to do.

The result is that the fallback is more robust, and doesn't trigger any
decoder error codepaths or messages either. Change our own fallback
message to a warning, since there are no other messages with error
severity anymore.
2015-05-28 21:52:04 +02:00
wm4 0949ee347d demux_lavf: do a better job at guessing the vobsub .sub filename
Vobsubs come as .idx/.sub pair of files. The .idx file is the one that
should be opened, but the name of the .sub file is unknown. We can now
make our own guess what the name of that file is. In particular, improve
support with URLs (as these can have the file extension in the middle of
the filename string if there are HTTP parameters).

Note that this works only with newer ffmpeg versions, because the
recently added sub_name demuxer option is used for this.
2015-05-28 21:51:54 +02:00
Marcin Kurczewski ce0bf9692f vo_drm: Expose mode ID option to users 2015-05-28 21:51:49 +02:00
Marcin Kurczewski eea625736f vo_drm: Fix resolution not restored after exiting 2015-05-28 21:51:49 +02:00
Marcin Kurczewski 5a1ef9d8db vo_drm: Fix stride problem for certain devices 2015-05-28 21:51:48 +02:00
wm4 dc2c7371f1 command: remove deprecated get_property command
This command has been deprecated in the 0.8.x and 0.9.x releases - get
rid of it. Its only point ever was MPlayer compatibility, which broke
years ago anyway.
2015-05-27 18:08:02 +02:00
wm4 e8a1d35e9c options: remove --slave-broken
It has been deprecated for ages.
2015-05-27 18:01:26 +02:00
wm4 ac6ebbbcbc player: set cocoa input context at an earlier point
There is not much of a reason to do this later. (Since some time ago,
the input_ctx is created right at the start, so this can be done now.)
2015-05-27 17:57:24 +02:00
wm4 ba45c410d3 player: load scripts at an earlier point
This is about as early as possible.
2015-05-27 17:53:58 +02:00
wm4 acc4102ba2 vo_opengl: rename use_full_range to use_normalized_range
As suggested by haasn. The term "full range" makes it sound like it has
to do with TV vs. PC range, which is not the case at all.
2015-05-27 17:40:58 +02:00
Stefano Pigozzi b50390d5da DOCS: fix wrong libmpv's cocoa example comment
libmpv can be embedded in a cocoa view (without the mpv window). This has been
the case for serveral months, and the comment is just wrong now.
2015-05-27 14:34:42 +02:00
Niklas Haas b65c548b7d vo_opengl: fix source-shader + XYZ input 2015-05-27 11:32:42 +02:00
wm4 ae1ac475ac DOCS: interface-changes: mention recent vo_opengl additions 2015-05-27 11:28:21 +02:00
Niklas Haas 22af0dce0d vo_opengl: CMS no longer implies linear scaling
They're completely orthogonal concepts, merged in the past due to
convenience and ease of implementing it in the old #ifdef hell renderer.

Especially after the CMS stuff was generalized by 634b4a, this was a
trivial change to implement and also means color management will be much
higher quality when enabled with vo=opengl (which had quantization
issues in the past due to the 8 bit FBO format and upscaling), since it
can be done in a single pass now.
2015-05-27 11:24:12 +02:00
Niklas Haas 13d4ee6d1c vo_opengl: icc-profile overrides icc-profile-auto
Signed-off-by: wm4 <wm4@nowhere>
2015-05-27 11:23:16 +02:00
Niklas Haas 4d6b9550fe
vo_opengl: add support for custom shaders 2015-05-27 11:09:41 +02:00
wm4 bf4dd877e9 osx: synchronize access to the input_ctx
While all functions of input_ctx are inherently thread-safe, access to
the _inputContext field itself is not. It could be unset any time by
cocoa_set_input_context(). So even trivial input_ctx calls must be under
a lock, so that the input_ctx can not be destroyed while the function
call is "starting". (Even a function call in progress wouldn't be fine,
because mp_input_uninit() requires the caller to "own" the object, i.e.
no other threads can access it at this point.)
2015-05-26 22:48:04 +02:00
wm4 2dd904289d osx: never expose input_ctx from EventsResponder
Keep it internal, so we can synchronize access to it properly.
2015-05-26 22:39:04 +02:00
wm4 39a339c813 input: remove some unneeded things
Wakeup FDs are not needed anymore (this code exists only for libwaio
usage by now), and 2 other functions can be made private.
2015-05-26 22:00:25 +02:00
wm4 51654d2ad5 command: better choice when to allow playback-related commands
For certain reasons, we allow adding external tracks even before the
main file is loaded. This somewhat breaks in old assumption, which uses
mpctx->num_sources to determine whether a command can be applied in the
current state. Use the newer playback_initialized instead, which is a
much better choice for this purpose.
2015-05-26 21:42:34 +02:00
wm4 3c24250c14 command: fix track property when no file is loaded
The previous commit removed this. Although mp_switch_track() can now be
called in all situations, we still don't want it to be called here.
Setting a track property while no file is loaded would simply deselect
the track instead of setting the underlying option to the requested
value.

Likewise, if the "cycle" command (M_PROPERTY_SWITCH) is used, don't just
deselect the track.
2015-05-26 21:33:34 +02:00
wm4 88249baf5b player: fix crashes when adding external tracks before loading main file
Adding an external audio track before loading the main file didn't work
right. For one, mp_switch_track() assumes it is called after the main
file is loaded. (The difference is that decoders are only initialized
once the main file is loaded, and we avoid doing this before that for
whatever reason.)

To avoid further messiness, just allow mp_switch_track() to be called at
any time. Also make it do what mp_mark_user_track_selection() did, since
the latter requires current_track to be set. (One could probably simply
allow current_track to be set at this point, but it'd interfere with
default track selection anyway and thus would be pointless.)

Fixes #1984.
2015-05-26 14:01:23 +02:00
wm4 bdcd25d3c2 demux: don't get stuck on some cases of timestamp resets
In this case, streaming ogg via mpd over icecast made it buffer
infinitely on new tracks.
2015-05-26 12:59:48 +02:00
wm4 302901ddaf ao_alsa: hack back mono output
The ALSA API is inconsistent and doesn't report support. Just requesting
1 channel actually works. Whatever.
2015-05-25 22:10:35 +02:00
wm4 446a10020f TOOLS/lua/status-bar: update use of a deprecated property
Also mention that this code does not reflect the status line of current
mpv.
2015-05-25 22:01:34 +02:00
wm4 289705daaf input: allow - as separator between commands, instead of _
Wnile it seems quite logical to me that commands use _ as word
separator, while properties use -, I can't really explain the
difference, and it tends to confuse users as well. So always
prefer - as separator for everything.

Using _ still works, and will probably forever. Not doing so would
probably create too much chaos and confusion.
2015-05-25 21:59:44 +02:00
wm4 6bfbd4ebdc command: change the hwdec properties
Another very minor step towards property/option unification.

Not bothering with interface compatibility here.
2015-05-25 21:44:48 +02:00
wm4 449cdfc0ff vd_lavc: report actually used hwdec API
Instead of the requested one, which can be just "auto", and which is
rather useless.
2015-05-25 21:43:20 +02:00
wm4 3fc3357d54 vf_dlopen: declare as deprecated
Mostly to see whether someone uses it, and if a better solution can be
worked out. (It's simple enough to be supported forever.)
2015-05-25 21:13:54 +02:00
Stefano Pigozzi 34875413fa cocoa: don't load hardcoded icon if running from bundle
Makes ricers happy.
2015-05-25 08:58:32 +02:00
wm4 05a75d0a76 demux_edl: fix includes
It doesn't need access to the playback core state anymore.
2015-05-24 23:27:23 +02:00
wm4 f3dcd85150 video: do not use MP_NOPTS_VALUE for A/V difference
There's no need for this, it just creates more corner cases.

Also always reset it on seeks etc..
2015-05-24 23:27:23 +02:00
wm4 58e7d0a30b player: add function to compute past frame durations
And use it for the estimated-vf-fps property (it should be doing the
same as before).
2015-05-24 23:27:23 +02:00
wm4 0d0444fed0 vo_null: add framerate emulation 2015-05-24 23:27:18 +02:00
Philip Sequeira 9e77b8f06a manpage: --media-title -> --force-media-title
Missed in 450af053.
2015-05-24 01:16:12 -04:00
torque 36b1b84216 DOCS/client_api_examples/cocoa-openglcb: do initial flush correctly. 2015-05-23 19:21:10 +02:00
wm4 8054c034b8 command: add protocol-list property
Fixes #1972.
2015-05-23 15:26:55 +02:00
wm4 a3f8d45fb6 ytdl: do not use deprecated option
This was missed in commit 450af053.
2015-05-23 15:15:16 +02:00
Niklas Haas fa7b22c687 vo_opengl: switch to new OpenGL backend API for icc-profile-auto
The current code just segfaults.
2015-05-22 21:56:16 +02:00
wm4 f7ca2c83e1 command: allow changing track properties while no file is loaded
Now it simply changes the options, i.e. what will be requested, instead
of returning M_PROPERTY_UNAVAILABLE.

This is another minor step towards unifying options and properties.

Still a bit weird: it will always return "no" if no file is loaded, and
disregards the option value.
2015-05-22 21:05:03 +02:00
wm4 ae46833836 player: use an array for stream ID options and such
This makes the code slightly more generic.
2015-05-22 21:00:24 +02:00
wm4 a7c831f36d command: deprecate audio-samplerate
Also replace their implementation with the recently introduced
properties. One significant difference is that audio-channels using OSD
formatting does not print the channel layout. The user can just use the
replacement property instead.
2015-05-22 20:28:20 +02:00
wm4 f9507fe927 command: add audio-params and audio-out-params properties 2015-05-22 20:23:47 +02:00
wm4 1eaceb5fae command: remove old property deprecation warning mechanism
We don't need two.

This mechanism was basically for MPlayer, and it has expired its
usefulness by now.
2015-05-22 20:08:04 +02:00
wm4 ff0b33ac9d command: rename audio-format property
Clashes with the option.
2015-05-22 20:05:36 +02:00
wm4 450af05338 options: rename --media-title option
Conflicts with the property.
2015-05-22 20:03:14 +02:00
wm4 d26803cba0 command: deprecate the "length" property
It collides with the --length option.
2015-05-22 20:02:47 +02:00
wm4 c2f9e3d2b3 command: add a new property deprecation mechanism
Looks like this will be needed a lot...
2015-05-22 20:02:04 +02:00
wm4 17b3cab983 DOCS: add a changelog for option/command/property changes
All these make up both user interface and API. It's a good idea to
actually keep track of changes to it.
2015-05-22 19:16:42 +02:00
wm4 a165a61415 audio: make softvol scale cubic
This brings the volume control closer to what is percepted as linear
volume change.

Adjust the --softvol-max default to roughly the old maximum (roughly
doubles the gain).
2015-05-22 19:16:42 +02:00