Commit Graph

1205 Commits

Author SHA1 Message Date
wm4 32955d3529 client API: fix logging memory leak
Very stupid.

Was pointed out in #2056.
2015-06-18 18:40:12 +02:00
wm4 e00e9d651b player: make decoding cover art more robust
When showing cover art, the decoding logic pretends that the source has
an infinite number of frames. This slightly simplifies dealing with
filter data flow. It was done by feeding the same packet repeatedly to
the decoder (each decode run produces new output).

Change this by decoding once at the video initialization. This is easier
to follow, and increases robustness in case of broken images. Usually,
we try to tolerate decoding errors, so decoding normally continues, but
in this case it would just burn the CPU for no reason.

Fixes #2056.
2015-06-18 18:39:46 +02:00
wm4 72808be6f8 command: do not exit playback if the B point of A-B loop is past EOF
The previous behavior is confusing if the B point is near EOF (consider
B being the duration of the file, which is strictly speaking past the
last video timestamp). The new behavior is fine as well for B being far
past EOF.

Achieve this by checking the EOF state in addition to whether playback
has reached the B point. Also, move the A-B loop code out of
command_event(). It just isn't useful anymore, and obfuscates the code
more than it makes it loop simple.

Fixes #2046.
2015-06-16 23:11:14 +02:00
wm4 dbdc46c97a player: do not exit when a seek gets queued
Seems logical.

Note that if playback otherwise ends while playback is active and a seek
is still queued, we still exit. Otherwise you couldn't end playback by
seeking past the end of the file (which is classic MPlayer and mpv
behavior).
2015-06-16 23:07:46 +02:00
wm4 0d2456ae5f lua: support MPV_END_FILE_REASON_REDIRECT
And also add the missing "unknown" entry to the manpage.
2015-06-11 21:42:09 +02:00
wm4 e53cb0890e client API: add MPV_END_FILE_REASON_REDIRECT
Requested. Minor incompatible behavior change, as it was signalling
MPV_END_FILE_REASON_EOF previously.
2015-06-11 21:42:09 +02:00
wm4 87b60ded88 client API: leave mpv_event_end_file.error to 0 on no error
Making sure this is true makes it closer to the libmpv docs, and
possibly less confusing in corner cases.
2015-06-11 21:42:09 +02:00
wm4 ce513dedd8 lua: export end-file event fields 2015-06-11 21:42:09 +02:00
torque d0fe5e08b9 command: add keypress, keydown, and keyup commands.
These commands are used to simulate keypresses using the key names from
input.conf.
2015-06-11 21:42:09 +02:00
wm4 f51459c077 audio: add some change notifications
We must be sure that every change comes with a notification. Otherwise,
some property changes could possibly be missed.
2015-06-09 18:29:11 +02:00
wm4 3399b775b7 command: fix audio-out-detected-device property
Used a wrong condition, and I suppose it could crash in some situations.

Change it to lazily initialize the hotplug stuff, like the
audio-device-list property does.
2015-06-09 18:25:44 +02:00
wm4 bd64763076 command: remove unnecessary event IDs
These were actually not needed for correct function, since individual
property change notifications via mp_notify_property() are used.
2015-06-09 18:21:56 +02:00
wm4 9986593b50 command: make property event mask matching more restrictive
This was matching e.g. both "foo/bar" and "foobar" against "foo", when
only the former should match. This could cause more property
notifications than necessary.
2015-06-09 18:21:56 +02:00
Jaime Marquínez Ferrándiz 69abb48194 ytdl_hook: Support 'multi_video' results
They can be handled by the same codes used for playlists, most of them will use an EDL.
Fixes #2027.
2015-06-07 23:53:13 +02:00
wm4 57048c7393 audio: add --audio-spdif as new method for enabling passthrough
This provides a new method for enabling spdif passthrough. The old
method via --ad (--ad=spdif:ac3 etc.) is deprecated. The deprecated
method will probably stop working at some point.

This also supports PCM fallback. One caveat is that it will lose at
least 1 audio packet in doing so. (I don't care enough to prevent this.)

(This is named after the old S/PDIF connector, because it uses the same
underlying technology as far as the higher level protoco is concerned.
Also, the user should be renamed that passthrough is backwards.)
2015-06-05 22:42:59 +02:00
wm4 68aaffc711 audio: do not allow AO to change passthrough formats
This makes no sense, because the format can't be converted anyway. It
just sets up the filter chain init code, which will vomit a bunch of
useless and confusing messages. So uninit and fail explicitly when this
happens.
2015-06-05 22:34:47 +02:00
wm4 f30b28de46 video: remove worthless log message
All this information is already output otherwise. Except the FourCC,
which lost most of its importance in mpv.
2015-06-05 18:59:46 +02:00
wm4 54b6389873 vf_sub: minor simplification 2015-06-05 18:59:13 +02:00
wm4 c06cd1b993 audio: do not exit when loading small files in paused mode
When starting in paused mode, no audio is written to the device at all,
because writing audio implicitly unpauses the AO. If the file is very
small, and all audio fits within the AO buffer, this accidentally
triggered the EOF condition. (In unpaused mode, it would write all
audio, end playback, and then wait until the AO has everything played.)
2015-06-04 22:05:29 +02:00
wm4 04d5bf4f0b player: print track list when switching tracks 2015-06-03 21:52:32 +02:00
wm4 e14df5c4f4 player: print a message along with track list
Slightly less strange.
2015-06-03 21:50:37 +02:00
wm4 52bd61d698 player: don't print stream list when adding external tracks during load
There's a short time during loading where external commands can add
external streams even before the main file is loaded (like during ytdl
hook execution). The track list is printed every time an external track
is added via commands. This was quite awkward when ytdl was adding
multiple streams, so don't print it in this stage. They are printed
anyway at the end of the loading process.
2015-06-03 21:34:46 +02:00
wm4 a075dfb52c audio: remove an old hack
This was a cosmetic issue. It's handled differently now (clamping the
display time to known duration range).

This reverts commit 33b57f5557.
2015-05-30 22:01:09 +02:00
wm4 f44725b8d4 player: restore video-aspect on playback resume 2015-05-29 22:34:24 +02:00
wm4 327b091909 lua: fix options submodule
It polluted the global namespace, instead of exporting the function
properly.

For now, keep it compatible by explicitly keeping the bogus export.

Also fix a mistake in the manpage example.
2015-05-29 15:50:09 +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 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 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 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 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
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 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 68bbab0e42 audio: change range of volume option/property
Now --volume takes an absolute volume, meaning it doesn't depend on
--softvol-max. 0 is still silence, and 100 now always means unchanged
volume. The OSD and the "volume" property are changed accordingly.

Also raise the minimum value of --softvol-max. A value below 100 makes
no sense and breaks the OSD.
2015-05-22 18:35:03 +02:00
wm4 8c795d7963 command: explicitly show mouse cursor when unfullscreening 2015-05-21 23:11:51 +02:00
Robin 9bd3ae311f command: refactor if/else statements to switch
The code checking for the type of seeking contained some if else
statements. To improve readability, I decided to refactor those
statements to a switch statement.
2015-05-20 22:59:19 +02:00
wm4 0e78424842 video: force audio resync after video discontinuity 2015-05-20 14:28:02 +02:00