| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
This commit adds new property 'title' which indicates current
playing title of disc. This property is useful when using a stream
whose title can be changed during playback, e.g., dvdnav.
|
|
|
|
|
|
|
|
| |
Xlib.h (included from x11_common.h) defines a macro 'Status' as 'int'.
This messed up a bunch of definitions in windows.h and broke the build
in Cygwin. Including windows.h first seems to solve the problem.
This commit also removes the definition of an unused flag.
|
| |
|
| |
|
|
|
|
|
|
| |
This allows to propagate metadata information to audio filters.
Closes #632
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 75dd3ec2106701cb865f52966de66c51cb6f9204.
This broke seeking with ordered chapters in some situations. While
the reverted commit was perfectly fine for playback of normal files,
it overlooked that in the ordered chapters case switching segments
actually reinitialized the audio chain completely, including the
decoder. And decoders still read packets on initialization. We can
restore the original commit as soon as decoders stop doing this.
|
|
|
|
|
|
| |
This obviously doesn't work. It wasn't much of a problem in the past
because most passthrough formats use 2 channels, which is also the
default for downmix.
|
|
|
|
|
|
| |
Use the --channels value directly on the AO, instead of doing it only in
the --channels=stereo (default) case and if the decoder output is not
stereo.
|
|
|
|
|
|
|
|
|
|
| |
This is probably "safer". Without it, we will play 1 sample, because the
logic was written in a way to decode 1 sample if audio is paused. 1
sample usually will initialize the audio PTS, but not play any real
audio. Also see previous commit.
In ancient times, this actually used 1 byte (instead of 1 sample), so
clearly no sample was written, unless the audio was 8-bit mono.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the ao_buffer_playable_samples field. This contained the number
of samples that fill_audio_out_buffers() wanted to write to the AO (i.e.
this data was supposed to be played at some point), but ao_play()
rejected it due to partial fill.
This could happen with many AOs, notably those which align all written
data to an internal period size (often called "outburst" in the AO
code), and the accepted number of samples is rounded down to period
boundaries. The left-over samples at the end were still kept in
mpctx->ao_buffer, and had to be played later.
The reason ao_buffer_playable_samples had to exist was to make sure that
at EOF, the correct number of left-over samples was played (and not
possibly other data in the buffer that had to be sliced off due to
endpts in fill_audio_out_buffers()). (You'd think you could just slice
the entire buffer, but I suspect this wasn't done because the end time
could actually change due to A/V sync changes. Maybe that was the reason
it's so complicated.)
Some commits ago, ao.c gained internal buffering, and ao_play() will
never return partial writes - as long as you don't try to write more
samples than ao_get_space() reports. This is always the case. The only
exception is filling the audio buffers while paused. In this case, we
decode and play only 1 sample in order to initialize decoding (e.g. on
seeking). Actually playing this 1 sample is in fact a bug, but even of
the AO doesn't have period size alignment, you won't notice it. In
summary, this means we can safely remove the code.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Until now, this was always conflated with uninit. This was ugly, and
also many AOs emulated this manually (or just ignored it). Make draining
an explicit operation, so AOs which support it can provide it, and for
all others generic code will emulate it.
For ao_wasapi, we keep it simple and basically disable the internal
draining implementation (maybe it should be restored later).
Tested on Linux only.
|
| |
|
|
|
|
|
|
| |
We want to move the AO to its own thread. There's no technical reason
for making the ao struct opaque to do this. But it helps us sleep at
night, because we can control access to shared state better.
|
|
|
|
|
|
|
|
|
|
| |
This field will be moved out of the ao struct. The encoding code was
basically using an invalid way of accessing this field.
Since the AO will be moved into its own thread too and will do its own
buffering, the AO and the playback core might not even agree which
sample a PTS timestamp belongs to. Add some extrapolation code to handle
this case.
|
|
|
|
| |
Oops.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
For example, consider the case when audio initialization fails. Then the
audio track is deselected. Before this commit, this would have been
equivalent to the user disabling audio. This is bad when multiple files
are played at once (the next file would have audio disabled, even if it
works), or if playback resume is used (if e.g. audio output failed to
initialize, then audio would be disabled when resuming, even if the
system's audio driver was fixed).
|
|
|
|
| |
Pressing 'h' in idle mode -> crash.
|
|
|
|
|
|
|
|
|
|
|
| |
The OSC used significant CPU time while the player was paused. It turned
out that the "tick" event sent during pause is the problem. The OSC
accesses the player core when receiving a tick event, which in turn will
cause the core to send another tick event, leading to infinite feedback.
Fix this by sending an idle tick only every 500ms. This is not very
proper, but the idea behind the tick event isn't very clean to begin
with (and the OSC should use timers instead).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The playloop usually waits in select(), using a timeout needed for
refilling audio and video buffers. This means the client API needs
a separate mechanism to interrupt the select() call. This mechanism
exists, but I forgot to use it. This commit fixes it.
If it works, this will make the client API react faster, epsecially
in audio-only mode. If video is enabled, the reaction time is capped
to 50ms (or somewhat faster if the framerate is >20 fps), because
the playloop stops reacting to anything in order to render and time
the next video frame. (This will be fixed later by moving the VO
to its own thread.)
|
|
|
|
|
|
|
|
| |
luaL_loadstring(), which was used until now, uses the start of the Lua
code itself as chunk name. Since the chunk name shows up even with
runtime errors triggered by e.g. Lua code loaded from user scripts, this
looks a but ugly. Switch to luaL_loadbuffer(), which is almost the same
as luaL_loadstring(), but allows setting a chunk name.
|
|
|
|
|
| |
add_key_binding() didn't work, because it passed a flag that was
renamed. add_forced_key_binding() worked, but did the wrong thing.
|
| |
|
|
|
|
|
|
| |
(Again.)
Fixed Lua timers as well.
|
|
|
|
| |
Apparently this was overlooked when get_timer was renamed to get_time.
|
| |
|
|
|
|
| |
This sidestepped the usual logic by hardcoding the path.
|
| |
|
| |
|
|
|
|
|
|
| |
Rename MPV_EVENT_PLAYBACK_START to MPV_EVENT_FILE_LOADED.
Add MPV_EVENT_SEEK and MPV_EVENT_PLAYBACK_RESTART.
|
|
|
|
|
|
| |
Sending an asynchronous request and then calling mpv_destroy() would
crash the player when trying to send the reply to the removed client.
Fix this by waiting until all remaining replies have been sent.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The step argument for "add volume <step>" was ignored until now. Fix it.
There is one problem: by defualt, "add volume" should use the value set
with --volstep. This value is 3 by default. Since the default volue for
the step argument is always 1 (and we don't really want to make the
generic code more complicated by introducing custom step sizes), we
simply multiply the step argument with --volstep to keep it compatible.
The --volstep option should probably be just removed in the future.
|
|
|
|
|
|
|
| |
The value range is 0-100, so fractional values don't make much sense.
But the underlying data type is probably float to avoid getting "stuck"
when doing small volume increments. So step this around and pretend it's
an integer just on display.
|
|
|
|
|
|
| |
Probably completely useless, at least for now.
Also not very well tested, but initial test seems successful.
|
|
|
|
|
|
|
| |
Lua doesn't distinguish between arrays and maps on the language level;
there are just tables. Use metatables to mark these tables with their
actual types. In particular, it allows distinguishing empty arrays from
empty tables.
|
|
|
|
|
|
| |
Will be more expensive if used very often, but it's probably ok.
Reduce the dependency of lua.c on MPContext a bit further.
|
|
|
|
|
|
| |
For simplicity, this was sent before actually checking the idle
condition, which meant that we'd send it even of the idle loop is never
entered.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Always map MPV_FORMAT_STRING to setting property value directly through
M_PROPERTY_SET_STRING, instead of trying to go through
M_PROPERTY_SET_NODE.
This treats a direct MPV_FORMAT_STRING query differently from a
MPV_FORMAT_STRING wrapped in a mpv_node. This was already the case in
mpv_get_property(). The reason for all this is that mpv_node is supposed
to be the exact type, while a direct MPV_FORMAT_STRING goes through all
possible conversions.
Not sure if these semantics are good.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. Cannot set option after initialized: it seems that this bug has
existed since libmpv was introduced first. Maybe just a typo.
2. Crash when setting property with native format: mpv_set_property
just causes a crash when using a native format. I found an invalid
casting and fixed it.
3. Wrong error value for mpv_get_property: when an error occurred,
mpv_get_property always returns wrong format error because every
error for property except M_PROPERTY_NOT_IMPLEMENTED is just ignored.
Signed-off-by: wm4 <wm4@nowhere>
Closes pull request #593. Does not incldue the first fix, which was not
correct. The underlying bug will be fixed by a later commit.
Commit message extracted from pull request and slightly edited.
|
|
|
|
|
|
|
|
|
| |
E.g. binding MOUSE_BTN0 always used the user defined binding. While it
is ok that the user can override mouse_move and mouse_leave (for
whatever reasons), we want to strictly override the bindings when input
is sent to the OSC itself.
Regression since 03624a1.
|
|
|
|
|
| |
Allow changing all options at runtime, except some cherry-picked
options, which are disabled with M_OPT_FIXED.
|
|
|
|
|
|
|
|
|
|
|
| |
This lowers the number of data stored in the resume config a bit
further, because some properties can't be read at program start and when
e.g. the VO wasn't created yet.
Some fields still need to be read from a property (actually only
"volume-restore-data", a hack to save the full volume information). So
abuse the "options/" property, and make use of the fact that changing
things at runtime also changes the options.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is approximate: we read each option value on program start
(before starting playback of a file), and when writing the resume
config, compare each value to the current state. This also means
when a value is changed and then changed back, it's not stored. In
particular, option values set in config files and on the command
line are considered the default.
This should help reducing the numbers of options overridden by the
resume config. If too much is overridden, it becomes an inconvenience,
because changes in config files will apparently have no effect when
resuming a file.
Also see github issue #574.
|
|
|
|
|
|
| |
This created an essentially empty config file. This is not really
needed and probably causes more trouble than it solves (such as
littering the home directory with crap), so get rid of it.
|
|
|
|
|
|
|
|
|
| |
Not sure about this... might redo.
At least this provides a case of a broadcasted event, which requires
per-event data allocation.
See github issue #576.
|
|
|
|
|
|
|
|
|
| |
May or may not be useful in some ways.
We require a context parameter for this just to be sure, even if the
internal implementation currently doesn't.
That's one less mpv internal function for the Lua wrapper.
|
| |
|
| |
|
|
|
|
|
|
| |
There are some complications because the client API distinguishes
between integers and floats, while Lua has only "numbers" (which are
usually floats). But I think this should work now.
|
|
|
|
|
|
|
|
|
|
|
| |
This is only half-implemented: actually the option will first be
converted from mpv_node to its native type, then it's converted to a
string, and then back to its native type. This is because the option
API was made for strings and not anything else.
Other than being grossly inelegant, the only downside is probably with
string lists and key/value lists, which don't escape strings containing
syntax elements correctly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This actually makes use of the client.h declarations and the mpv_node
mechanisms added some commits ago.
For now, using MPV_FORMAT_STRING will usually fallback to explicit
string conversion, but not in the other cases. E.g. reading a numeric
property as string will work, but not reading a string property as
number. Other than that, only MPV_FORMAT_INT64->MPV_FORMAT_DOUBLE does
an automatic conversion.
I'm not sure whether these semantics and API are good, so comments and
suggestions are welcome.
|
|
|
|
|
| |
These error codes can be used for setting and getting, not just for
settings (although currently there's no API to get options directly).
|
|
|
|
|
|
|
|
|
|
|
|
| |
With mpv_set_property(h, "property", MPV_FORMAT_STRING, ptr), ptr now
has to be of type char** instead of char*. This makes it more consistent
with mpv_get_property() and also non-pointer formats, which will be
introduced in the following commits. mpv_set_property() of course does
not change its interface (only its implementation is adjusted to keep
its interface).
This also affects mpv_set_option(), but again not
mpv_set_option_string().
|
|
|
|
|
|
| |
Signed-off-by: wm4 <wm4@nowhere>
Closes #582.
|
|
|
|
|
|
| |
Signed-off-by: wm4 <wm4@nowhere>
Closes #575. Minor changes over original pull request.
|
|
|
|
|
|
| |
Until now, strings were the only allowed dynamically allocated argument
type in input commands. Extend it so that it works for any type. (The
string expansion in command.c is of course still string specific.)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some code accessed m_option.name to get the property name. (Maybe only
show_property_osd() had a significant use of it.) Remove that, and
remove setting names and dummy names as well.
The old code usually assumed that the name was set, and
show_property_osd() used it to get the proper name of deprecated
aliases.
The "vf" property was listed as "vf*". Not sure why that was done, but
it works without anyway.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
M_OPT_PARSE_ESCAPES was pretty stupid, and broke the (useful) assumption
that string variables contain exactly the same value as set by the
option. Simplify it, and move escape handling to the place where it's
used.
Escape handling itself is not terribly useful, but still allows useful
things like multiline custom OSD with "\n".
|
|
|
|
|
|
|
|
|
| |
MP_CMD_COMMAND_LIST commands (used to implement key bindings with
multiple commands) were not checked for abort commands. Implement it.
Remove the remarks about multi-commands being special from the manpage.
Seek coalescing is handled differently now, and the issue with abort
commands is fixed with this commit.
|
|
|
|
|
|
| |
Not sure about these deep path-names. Maybe "metadata/0" should work
instead of "metadata/list/0". I'm so unsure about it, that I'm leaving
it open.
|