| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
update_subtitle() already uees playback_pts to make subtitles work
better in no-audio mode. Using get_current_time() usually gets
playback_pts, but also has the advantage that it will use the seek
target time during seeks. This will result in multiple sub_seek commands
doing the right thing (at least as long as they're far enough apart so
that seeking is actually initiated when the second command is run).
|
|
|
|
|
|
|
| |
Use the "default" selection for the ff-index, not the "no" selection.
Broken by commit f0f83ff.
Fixes #1243.
|
|
|
|
|
|
| |
More or less requested by #1237.
Should be simple to extend this to other backends.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a generic mechanism to the VO to relay "extra" events from VO to
player. Use it to notify the core of window resizes, which in turn will
be used to mark all affected properties ("window-scale" in this case) as
changed.
(I refrained from hacking this as internal command into input_ctx, or to
poll the state change, etc. - but in the end, maybe it would be best to
actually pass the client API context directly to the places where events
can happen.)
|
|
|
|
| |
A client API user has no other way to know the version.
|
|
|
|
| |
Has been annoying me since forever.
|
|
|
|
|
|
|
|
|
| |
Instead of defining a separate data structure in the core.
For some odd reason, demux_chapter exported the chapter time in
nano-seconds. Change that to the usual timestamps (rename the field
to make any code relying on this to fail compilation), and also remove
the unused chapter end time.
|
|
|
|
|
|
|
|
| |
Note that you can't pass .cue or .edl files to it, at least not yet.
Requested in context of allowing to specify custom chapters. For that
to work well, we probably need to add some sort of chapter metadata
pseudo-demuxer.
|
|
|
|
| |
Fixes #1236.
|
|
|
|
|
| |
Rename the variable, update comments, and update the documentation of
the property which returns its value.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was shown only if decoder-framedropping was enabled, and only if at
least 50 frames were dropped by it. Since drop_frame_cnt used to mean
"number of late frames", this code made sense, but this is not the case
anymore: drop_frame_cnt can be even 0, all while video gets hopelessly
behind audio.
One problem with this is that short desync spikes (which usually can
probably dealt with) will also cause this message to be shown. If it
gets triggered too often, the code will need to be adjusted.
|
|
|
|
|
| |
Trades one strange thing against another, but seems slightly less
strange.
|
|
|
|
|
|
|
|
|
| |
For example, if --force-window is used, and video is switched off during
playback, then you need to redecide the rendering method to get subs
displayed correctly.
Do this by moving the state setup code into a function, and call it on
every frame.
|
|
|
|
|
| |
Hopefully less confusing, and hopefully doesn't exceed the terminal
width in any situation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If you played e.g. an audio-only file and something bad happened that
interrupted playback, the exit message could say "No files played".
This was awkward, so show a different message in this case.
Also overhaul how the exit status is reported in order to make this
easier. This includes things such as not reporting a playback error
when loading playlists (playlists contain no video or audio, which
was considered an error).
Not sure if I'm happy with this, but for now it seems like a slight
improvement.
|
|
|
|
|
|
| |
On OSD/terminal, just don't display the duration if unavailable.
Make the "length" property unavailable if duration is unavailable.
|
|
|
|
|
|
| |
This is probably what libmpv users want; and it also improves error
reporting (or we'd have to add a way to communicate such mid-playback
failures as events).
|
|
|
|
|
|
|
|
| |
This was probably done incorrectly in cases when the currently selected
channel had no data. I'm not sure if this codepath is functional at all,
though. Maybe not.
Untested due to lack of DVB hardware.
|
|
|
|
| |
Give somewhat more information on playback failure.
|
|
|
|
|
|
|
|
|
| |
Using magic integer values was an attempt to keep the API less verbose.
But it was probably not a good idea.
Reason 1 (restart) is not made explicit, because it is not used anymore
starting with the previous commit. For ABI compatibility, the value is
left as a hole in the enum.
|
|
|
|
|
|
|
| |
Use the codepath that is normally used for DVD/BD title switching and
DVB channel switching. Removes some extra artifacts from the client API:
now MPV_EVENT_END_FILE will never be called on reloads (and neither is
MPV_EVENT_START_FILE).
|
|
|
|
|
| |
The playlist may be non-empty even if the player is idle. Instead of playing the
first entry, play the entry that was just added.
|
|
|
|
|
|
|
|
| |
Without --force-window, this is called on every iteration or so, and
calling uninit_video_out() sends the video-reconfig event. Avoid sending
redundant events.
Fixes #1225 (using an alternative patch).
|
| |
|
|
|
|
| |
Meant for changing the --audio-device at runtime.
|
|
|
|
|
| |
Anticipated use: simple solution for dealing with audio APIs which
request configuration changes via events.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Pretty much a fringe-feature, but also it's awkward if something appears
on the terminal with no indication for the source.
This is made quite awkward by the fact that stderr and stdout could be
closed at different times, and that poll() doesn't accept "holes" in its
FD list. Invalid (.e.g negative) FDs just make it return immediately, as
required by the standard. So sparse_poll() takes care of the messy
details.
|
|
|
|
| |
It accidentally had the opposite meaning.
|
|
|
|
|
|
|
| |
What was the purpose of that? Probably none.
Also simplify another thing: if we get the cancel signal through FD,
there's no reason to check it separately.
|
|
|
|
|
|
|
|
|
|
|
| |
No development activity (or even any sign of life) for almost a year.
A replacement based on youtube-dl will probably be provided before the
next mpv release. Ask on the IRC channel if you want to test.
Simplify the Lua check too: libquvi linking against a different Lua
version than mpv was a frequent issue, but with libquvi gone, no
direct dependency uses Lua, and such a clash is rather unlikely.
|
|
|
|
| |
Why can't it just raise an error?
|
|
|
|
|
| |
Lua is so clever it allows values that can't be converted to strings, in
which case lua_tostring() returns NULL. Trigger undefined behavior.
|
|
|
|
|
| |
Translation: if the (to be added) youtube-dl Lua script crashes, don't
wait forever when opening something.
|
|
|
|
|
|
|
|
|
| |
So a client API user can know when a window is created or destroyed.
Also might be useful for the OSC: it could disable itself if video is
disabled.
Before this commit, there were only indirect ways of detecting this.
|
|
|
|
| |
Otherwise, it'd retry creating the window all the time.
|
|
|
|
|
| |
This event basically means "something about video changed", and uninit
is certainly an important change.
|
|
|
|
|
|
|
|
| |
Most things should be allowed to access the client API unconditionally
(for example for sending events), so move destroying the client API
down. Also, mp_uninit_ipc() should happen before the point at which all
clients are shutdown, or there will be a small time window in which new
clients can be created after destroying them all.
|
|
|
|
| |
It was a bit ugly/annoying.
|
|
|
|
|
|
|
|
|
|
|
| |
Wether and when the text of a button should be squeezed when it
gets too long can now be configured in the layout:
lo.button.maxchars = <number>
nil = no squeezing (default)
If the button text has more than <maxchars> characters, it will
be squeezed to the estimated width of <maxchars>.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The player was supposed to exit playback if both video and audio failed
to initialize (or if one of the streams was not selected when the other
stream failed). This didn't work; for one this check was missing from
one of the failure paths. And more importantly, both checked the
current_track array incorrectly.
Fix these issues, and move the failure handling code into a common
function.
CC: @mpv-player/stable
|
|
|
|
| |
Let's actually test our code next time.
|
|
|
|
|
| |
Useful for debugging. Considered doing this in command.c, but it's
easier here.
|
| |
|
|
|
|
|
| |
This avoids reloading a subtitle if it was already added. In all cases,
the subtitle is selected.
|
| |
|
|
|
|
|
|
| |
Instead of just disabling the stream.
Also, check if the selected track has the right type, or we'd crash.
|
|
|
|
| |
Same as it's done on the terminal.
|
|
|
|
|
|
|
| |
Because Lua is so terrible, it's easy to confuse temporary values pushed
to the Lua stack with arguments if the arguments are checked after that.
Add a hack that should fix this.
|
|
|
|
|
|
|
|
|
| |
The behavior of reverse cycling (with the "!reverse" magic value) was a
bit weird and acted with a "delay". This was because the command set the
value the _next_ command should use. Change this and make each command
invocation select and use the next command directly. This requires an
"uninitialized" special index in the counter, but that is no problem at
all.
|
|
|
|
|
|
|
|
|
|
|
| |
Due to the way video-rotate currently works, the state will be
automatically updated once new video is decoded. So the filter chain
doesn't need to be reinitialized automatically, but there is a need to
trigger the video instant refresh code path instead.
Also move the support function closer to an annoying similar yet
different function. They probably can be unified next time major changes
are done to this code.
|
|
|
|
|
| |
I suspect this clashes with libcs,w hich define "stdout" as macro.
Hopefully fixes #1206.
|
|
|
|
|
|
|
|
|
|
|
| |
Allows properly changing/updating the cursor state. Useful for client
API window embedding, because the host application may not want the mpv
window to grab mouse input, and this has to manually handle the cursor.
Changing the cursor of foreign windows is usually not sane.
It might make sense to allow changing the cursor icon, but that would be
much more complicated, so I won't add it unless someone actually
requests it.
|
|
|
|
| |
Now this is obscure.
|
| |
|
|
|
|
|
|
|
|
|
| |
Apparently using the stream index is the best way to refer to the same
streams across multiple FFmpeg-using programs, even if the stream index
itself is rarely meaningful in any way.
For Matroska, there are some possible problems, depending how FFmpeg
actually adds streams. Normally they seem to match though.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Getting subtitle scaling and positioning right even if there are video
filters, which completely change the image (like cropping), doesn't seem
to have a single, correct solution. To some degree, the results are
arbitrary, so we may as well do what is most useful to the user.
In this case, if the PGS resolution aspect ratio and the video output
aspect ratio mismatch, letter-box it, instead of stretching the subs
over the video frame. (This will require additional fixes, should it
turn out that there are PGS subtitles which are stretched by design.)
Fixes #1205.
|
| |
|
|
|
|
| |
So the user doesn't have to care about the awkward low-level details.
|
| |
|
|
|
|
|
| |
I doubt anyone will actually use this correctly. Also, there was a bug
(a typo) which prevented it from working at all.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It turns out the glibc people are very clever and return an error if the
thread name exceeds the maximum supported kernel length, instead of
truncating the name. So everyone has to hardcode the currently allowed
Linux kernel name length limit, even if it gets extended later.
Also the Lua script filenames could get too long; use the client name
instead.
Another strange thing is that on Linux, unrelated threads "inherit" the
name by the thread they were created. This leads to random thread names,
because there's not necessarily a strong relation between these threads
(e.g. script command leads to filter recreation -> the filter's threads
are tagged with the script's thread name). Unfortunate.
|
|
|
|
|
|
|
|
|
|
| |
Especially with other components (libavcodec, OSX stuff), the thread
list can get quite populated. Setting the thread name helps when
debugging.
Since this is not portable, we check the OS variants in waf configure.
old-configure just gets a special-case for glibc, since doing a full
check here would probably be a waste of effort.
|
|
|
|
|
| |
This seems safer. It might be possible that commands sent by the clients
could recreate e.g. audio or video outputs.
|
|
|
|
| |
Just a minor refactor to keep unneeded dependencies on the core low.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Thanks to the recently introduced mp_lua_PITA(), this is "simple" now.
It fixes leaks on Lua errors. The hack to avoid stack overflows
manually isn't needed anymore, and the Lua error handler will take
care of this.
|
|
|
|
|
|
|
| |
The JSON parser was introduced for the IPC protocol, but I guess it's
useful here too.
The motivation for this commit is the same as with 8e4fa5fc (again).
|
|
|
|