0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 20:03:10 +02:00
Commit Graph

194 Commits

Author SHA1 Message Date
wm4
0fa9e2bff0 command: add playback-abort property
Now this is obscure.
2014-10-21 13:38:41 +02:00
wm4
cdbc865ad0 command: add video-rotate property 2014-10-21 13:31:30 +02:00
wm4
f0f83ff366 player: add stream selection by ffmpeg index
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.
2014-10-21 13:19:20 +02:00
Kevin Mitchell
599c510902 command: add field-dominance property 2014-10-21 00:55:15 +02:00
wm4
131633b4e5 command: extend sub_add command 2014-10-21 00:15:04 +02:00
wm4
b79f291f4b command: remove hook cancellation mechanism
I doubt anyone will actually use this correctly. Also, there was a bug
(a typo) which prevented it from working at all.
2014-10-20 23:43:10 +02:00
wm4
a67be5dd05 command: allow sub_add at an earlier stage 2014-10-20 23:33:46 +02:00
wm4
0328fa2252 command: add "estimated-vf-fps" change notifcation 2014-10-19 05:51:37 +02:00
wm4
8e4fa5fcd1 command: add a mechanism to allow scripts to intercept file loads
A vague idea to get something similar what libquvi did.

Undocumented because it might change a lot, or even be removed. To give
an idea what it does, a Lua script could do the following:

--                      type       ID priority
mp.commandv("hook_add", "on_load", 0, 0)
mp.register_script_message("hook_run", function(param, param2)
    -- param is "0", the user-chosen ID from the hook_add command
    -- param2 is the magic value that has to be passed to finish
    -- the hook
    mp.resume_all()
    -- do something, maybe set options that are reset on end:
    mp.set_property("file-local-options/name", "value")
    -- or change the URL that's being opened:
    local url = mp.get_property("stream-open-filename")
    mp.set_property("stream-open-filename", url .. ".png")
    -- let the player (or the next script) continue
    mp.commandv("hook_ack", param2)
end)
2014-10-16 01:00:22 +02:00
wm4
bc0ed90481 command: allow setting per-file options at runtime
The intended use-case is for doing this at load time, after the load
command was issued. (See following commit.)
2014-10-15 22:39:33 +02:00
wm4
b9077214cf command: don't display non-sense if volume is unavailable
Showed "Volume: (unavailable)%". That was dumb.

The message string is now a bit convoluted; mostly because the property
expand syntax can't do "if-else", just "if".

CC: @mpv-player/stable
2014-10-11 21:35:08 +02:00
wm4
a3bf75279e command: make volume/mute unavailable if audio is not initialized
This does nothing good. This reverts a change made over a year ago - I
don't remember why this was originally done this way.

The main problem is that even if the volume option is set (something
like "--volume=75"), the volume property will always return "100" until
audio is initialized. If audio is uninitialized again, the volume
property will remain frozen at its last value.
2014-10-11 21:35:08 +02:00
wm4
2f28e071c8 command: make audio device list available to the client API 2014-10-10 19:49:10 +02:00
wm4
4758866a18 player: minor simplification 2014-10-10 15:13:04 +02:00
wm4
f93419f6b2 player: --save-position-on-quit should always work (2)
This reimplements the feature reverted in the previous commit in a
different way.
2014-10-10 14:44:22 +02:00
wm4
3cbd79b35b command: add cache-buffering-state property 2014-10-07 22:13:36 +02:00
wm4
128bb68d29 client API: clarify pause/unpause events, modify core-idle property
Whether you consider the semantics weird or not depends on your use
case, but I suppose it's a bit confusing anyway. At this point, we keep
MPV_EVENT_PAUSE/UNPAUSE for compatibility only.

Make the "core-idle" property somewhat more useful in this context.
2014-10-07 21:01:19 +02:00
wm4
9d5d031b6d player: remove central uninit_player() function and flags mess
Each subsystem (or similar thing) had an INITIALIZED_ flag assigned. The
main use of this was that you could pass a bitmask of these flags to
uninit_player(). Except in some situations where you wanted to
uninitialize nearly everything, this wasn't really useful. Moreover, it
was quite annoying that subsystems had most of the code in a specific
file, but the uninit code in loadfile.c (because that's where
uninit_player() was implemented).

Simplify all this. Remove the flags; e.g. instead of testing for the
INITIALIZED_AO flag, test whether mpctx->ao is set. Move uninit code
to separate functions, e.g. uninit_audio_out().
2014-10-03 23:05:09 +02:00
wm4
1482a6fece command: don't show message on "osd" command by default
Apparently this was not very popular.

CC: @mpv-player/stable
2014-10-03 03:43:14 +02:00
wm4
4332105352 command: allow passing memory addresses to overlay_add
For the sake of libmpv. Might make things much easier for the user,
especially on Windows. On the other hand, it's a bit sketchy that a
command exists that makes the player access arbitrary memory regions.
(But do note that input commands are not meant to be "secure" and never
were - for example, there's the "run" command, which obviously allows
running random shell commands.)
2014-10-03 01:24:48 +02:00
wm4
3e899b102e command: restructure overlay_add code
Somewhat more flexible: now there's a separate overlay struct, and you
don't need to coerce all state into struct sub_bitmap. Also, removing
the previous mapping (munmap call) is now all in one place, the
replace_overlay function.

Makes the next commit easier to implement.
2014-10-03 01:22:07 +02:00
wm4
c3e2a1febc command: move setting playback speed to a separate function 2014-10-02 02:49:05 +02:00
wm4
8fd954ac8e build: add -Wno-format-zero-length
This warning makes absolutely no sense. Passing an empty string to
printf-like functions is perfectly fine. In the OSD case, it just sets
an empty message, practically clearing the OSD.
2014-09-26 13:52:55 +02:00
wm4
2cfc35892c command: no space before "%" in volume default OSD message
More consistent with other output, such as the terminal status line.

Also see issue #1103.
2014-09-22 18:07:34 +02:00
wm4
14ff4cf318 command: improve "osd" command
Be less annoying, print the actual OSD level instead of something
meaningless, but still clear the OSD if OSD level 0 (no OSD) is set.

Remove the special handling for terminal OSD, that was just dumb.
2014-09-22 00:25:59 +02:00
wm4
709002a3b2 command: use show_property_osd() sub_step
Simpler and more consistent.
2014-09-22 00:08:19 +02:00
wm4
c99a966251 command: when changing a property, always show it on OSD
This means that if a property not listed in property_osd_display[] is
changed, it will be shown on the OSD as "name: ${name}".

Properties that are listed in property_osd_display[] and have osd_name
not set stay invisible by default. This is used for "pause" and
"fullscreen", which (like before this commit) are not shown by default,
because it would be annoying.

The defaults still can be changed with command prefixes (osd-msg,
no-osd, others).
2014-09-21 23:54:33 +02:00
wm4
903bd1d893 command: simplify OSD property display code
Probably not many user-visible changes. One notable change is that the
terminal OSD code for OSD bar fallback handling is removed with no
replacement. Instead, terminal OSD gets the same text message as normal
OSD. For volume, this is ok, because the text message is reasonable.
Other properties will look worse, but could be adjusted, and there are
in fact no other such properties that would be useful in audio-only
mode.

The fallback message for seeking falls away as well, but that message
was useless anyway - the terminal status line provides all information
anyway.

I believe the show_property_osd() code is now much easier to follow.
2014-09-21 23:48:24 +02:00
wm4
4a0bbe256e command: allow changing some OSD-related options even with no VO
If no VO was open, these options couldn't be changed or even queried.
Although these properties are nearly useless if no VO exists, there's
actually no good reason to forbid querying or setting them. Also, even
if the VO is created, it doesn't mean the VO window was created.
2014-09-21 16:01:53 +02:00
wm4
60ca2d8f4d command: remove unneeded ifdefs
Why bother?

Also, since now some properties could be mapped to non-existing options,
but mp_property_generic_option() is used, deal with this case and return
a not-found error code.
2014-09-21 16:00:03 +02:00
wm4
a0cee03394 command: always show OSD message when changing volume etc.
If there's a command that uses the OSD by default, then always print the
associated message (or a fallback made of name + value), even if the
command has an associated OSD bar.

This means volume, gamma, panscan, etc. all show both a message and a
OSD bar.

Also, add a '%' to the volume message. The extra_msg thing is not needed
anymore.

See issue #1103.
2014-09-21 15:55:22 +02:00
wm4
58db0a55f3 options: remove --volstep
It's just confusing; users are encouraged to edit input.conf instead
(changing the argument to the "add" command).

Update input.conf to keep the old behavior.
2014-09-21 15:41:33 +02:00
wm4
6c3d25e6f5 command: allow using ASS tags on OSD messages
We don't allow this by default, because it would be silly if random
external data (like filenames or file tags) could accidentally trigger
them.

Add a property that magically disables this ASS tag escaping.

Note that malicious input could still disable ASS tag escaping by
itself. This would be annoying but harmless.
2014-09-18 00:49:55 +02:00
wm4
a522441bbe command: add osd-sym-cc property
This allows you to reproduce the OSD symbol.
2014-09-18 00:12:59 +02:00
Ben Boeckel
b41ece5ad4 command: avoid a double -> int cast
Just check against zero directly.

Changes behavior, but that should be ok.

Signed-off-by: wm4 <wm4@nowhere>
2014-09-16 17:33:47 +02:00
wm4
e267ff93f3 video: rename VOCTRL_GET_WINDOW_SIZE
Make it clear that this accesses the un-fullscreened window size.
2014-09-05 01:52:16 +02:00
wm4
bf74a4cc46 player: add --media-title option
Requested by ChrisK2.
2014-09-02 22:28:11 +02:00
wm4
8d92128f6b command: remove broken quvi-format property
Never really worked, and libquvi is probably a lost cause anyway.
2014-09-01 23:27:33 +02:00
wm4
2f537bafa5 demux: get rid of old wrapper
demux_info_get() used to be central, but was turned into a wrapper, and
now there was only one caller left. Get rid of it.
2014-09-01 22:12:39 +02:00
wm4
4124a175e1 command: disable some commands/properties properly in idle mode
In particular, don't allow to add any external subtitle tracks in idle
mode. This make no sense and would just lead to leaks or worse.
2014-09-01 21:44:54 +02:00
Ryan Jacobs
66f158b89b command: remove extra space
Signed-off-by: wm4 <wm4@nowhere>
2014-08-29 11:58:25 +02:00
wm4
e47a9bd721 command: export demuxer cache info properties 2014-08-28 17:49:10 +02:00
wm4
f9f436a490 audio: restore old speed change behavior
Don't attempt to resync after speed changes. Note that most other cases
of audio reinit (like switching tracks etc.) still resync, but other
code paths take care of setting the audio_status accordingly.

This restores the old behavior of not trying to fix audio desync, which
was probably changed with commit 261506e3.

Note that the code as of now wasn't even entirely correct, since the A/V
sync values are slightly shifted. The dsync depends on the audio buffer
size, so a larger buffer size will show more extreme desync. Also see
mplayer2 commit 213a224e, which should fixed this - it was not merged
into mpv, because it disabled audio for too long, resulting in a worse
user experience. This is similar to the issue this commit attempts to
fix.

Fixes: #1042 (probably)
CC: @mpv-player-stable
2014-08-28 14:26:38 +02:00
wm4
95286cd8b8 command: change OSD formatting of "speed" property
The "x   " prefix annoyed some users.
2014-08-25 00:48:55 +02:00
wm4
5afc025cc9 video: get rid of video_next_pts field
Not really needed anymore. Code should be mostly equivalent.

Also get rid of some other now-unused or outdated things.
2014-08-22 14:22:06 +02:00
Andrey Morozov
1cb15316b0 command: add estimated-frame-count & estimated-frame-number properties
Signed-off-by: wm4 <wm4@nowhere>
2014-08-19 21:47:14 +02:00
wm4
52ead45f05 command: drop " %" from "cache" property OSD-formatting 2014-08-18 01:42:43 +02:00
wm4
543ba6c114 video: add VO framedropping mode
This mostly uses the same idea as with vo_vdpau.c, but much simplified.

On X11, it tries to get the display framerate with XF86VM, and limits
the frequency of new video frames against it. Note that this is an old
extension, and is confirmed not to work correctly with multi-monitor
setups. But we're using it because it was already around (it is also
used by vo_vdpau).

This attempts to predict the next vsync event by using the time of the
last frame and the display FPS. Even if that goes completely wrong,
the results are still relatively good.

On other systems, or if the X11 code doesn't return a display FPS, a
framerate of 1000 is assumed. This is infinite for all practical
purposes, and means that only frames which are definitely too late are
dropped. This probably has worse results, but is still useful.

"--framedrop=yes" is basically replaced with "--framedrop=decoder". The
old framedropping mode is kept around, and should perhaps be improved.
Dropping on the decoder level is still useful if decoding itself is too
slow.
2014-08-15 23:33:33 +02:00
wm4
a87005b7fa command: for OSD, format cache property as integer
For convenience. Use ${=cache} to get the old formatting.
2014-08-11 13:30:08 +02:00
wm4
b016f92309 command: fix dangling pointer issue in script key bindings code
This code was sending a string to a different thread, and then
deallocated the string shortly after, which means most of the time
the other thread was accessing a dangling pointer.

It's possible that this is the cause for #1002.
2014-08-11 13:00:57 +02:00