1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-17 21:27:08 +00:00
Commit Graph

40037 Commits

Author SHA1 Message Date
wm4
62c7a372ec player: don't ignore relative seeks by 0 seconds
I don't know why this done; most likely it had no real reason.

Remove it because it breaks "refresh seeks" to the same position.
(Although the refresh seeks mpv sometimes does were fine.)
2015-01-25 17:00:11 +09:00
wm4
0692da3007 command: avoid returning invalid FPS values
It's possible that fps is sometimes 0 in case it's unset.
2015-01-25 17:00:11 +09:00
wm4
0fcb96139d player: reset frame step counter on seeks
I suppose this wasn't done in order to keep the frame step counter
active even in the next file, but actually it was reset anyway.
2015-01-25 17:00:11 +09:00
wm4
5f6b5feac6 lua: add a function that formats Lua values as strings
Yep, Lua is so crappy that the stdlib doesn't provide anything like
this.

Repurposes the undocumented mp.format_table() function and moves it to
mp.utils.
2015-01-25 17:00:11 +09:00
wm4
e2a4fde6de build: don't install some files if only libmpv is built
encoding-profiles.conf can be used by libmpv, but it won't load it
from this path by default, so exclude it as well.

Fixes #1293.
2015-01-25 17:00:11 +09:00
Kevin Mitchell
01401b5f5b ao/wasapi: handle VistaBlob failure more gracefully 2015-01-25 17:00:11 +09:00
Kevin Mitchell
f794eca255 ao/wasapi: remove unnecessary check of audio thread input
it would have caused a deadlock if it fired anyway.
2015-01-25 17:00:11 +09:00
Kevin Mitchell
ad2a461a09 ao/wasapi: more consistent/reliable method of computing extra WAVEFORMATEXTENSIBLE size 2015-01-25 17:00:11 +09:00
Kevin Mitchell
2e931b34f4 ao/wasapi: more missed cleanup on failure 2015-01-25 17:00:11 +09:00
Kevin Mitchell
ade8b6214d ao/wasapi: check return values
Only issue a warning for failure of wasapi_enumerate_devices and
wasapi_fill_VistaBlob.
2015-01-25 17:00:11 +09:00
Kevin Mitchell
78e957a2bd ao/wasapi: make functions return bool that were acting like it
this involved inverting the logic of find_formats, enumerate_devies
and wasapi_fill_VistaBlob. The latter two were trivial as their return
values were not actually checked (to be fixed in a later
commit).
2015-01-25 17:00:11 +09:00
Kevin Mitchell
9eb75631c7 ao/wasapi: check full GUID of KSDATAFORMAT to determine float 2015-01-25 17:00:11 +09:00
Kevin Mitchell
0c8a419775 ao/wasapi: expose GUID and PKEY convenience functions
Give them the prefix mp_ and make them nonstatic.
2015-01-25 17:00:10 +09:00
Kevin Mitchell
885c6e5b07 ao/wasapi: remove unused variable 2015-01-25 17:00:10 +09:00
Kevin Mitchell
44a7649e79 ao/wasapi: safely define PKEY constants
Before these definitions were incorrectly guarded by and #ifdef
but since they aren't macros, this would never be true so that
if they were ever added to mingw headers we would have problems.

rename KSDATAFORMAT constants with the same mp prefix for consistency.
also use DEFINE_GUID rather than defining the bare structure
2015-01-25 17:00:10 +09:00
Kevin Mitchell
fded4de8a7 ao/wasapi: avoid redundant passing of ao and wasapi_state as arguments
also drop some useless const declaraitons
2015-01-25 17:00:10 +09:00
Kevin Mitchell
f20575f3dd ao/wasapi: just return 0 unconditionally from the thread
We weren't actually checking this value anyway. We only really
cared about init failure, which was checked another way.
2015-01-25 17:00:10 +09:00
Kevin Mitchell
1936cfdb09 ao/wasapi: fix unmatched CoUninitialize() on init failure 2015-01-25 17:00:10 +09:00
Kevin Mitchell
84c2dc882d ao/wasapi: more debugging messages 2015-01-25 17:00:10 +09:00
Kevin Mitchell
d72718ca65 ao/wasapi: simplify the init retry 2015-01-25 17:00:10 +09:00
Kevin Mitchell
8a73b02952 ao/wasapi: make get_device_delay return an error code 2015-01-25 17:00:10 +09:00
wm4
b4174ab4e9 ao_wasapi: don't treat SetDisplayName() failure as fatal
Same for SetIconPath().
2015-01-25 17:00:10 +09:00
wm4
ce5f0f1a7a demux_playlist: detect headerless m3u files by extension
m3u files are normally just text files with a list of filenames. Nothing
actually mandates that there is a header. Until now, we've rejected such
files, because there's absolutely no way to detect them.

If nothing else claims the file, the extension is ".m3u", and if the
contents of the file look like text, then load it as m3u playlist. The
text heuristic is pretty cheap, but at least it should prevent trying
to load binary data as playlist. (Which would "work", but result in a
catastrophic user experience.)

Due to the text heuristic, UTF-16/32 files will be rejected (unless they
have a header), but I don't care.
2015-01-25 17:00:10 +09:00
ChrisK2
e02146b0c0 ytdl_hook: Check for empty playlists
Sometimes we get empty playlists back, print a warning message
instead of crash
2015-01-25 17:00:10 +09:00
James Ross-Gowan
804468b1ac subprocess-win: Always quote argv[0]
If the program name isn't quoted and the .exe it refers to isn't found,
CreateProcess will add the program arguments to the program name and
continue searching, so for "program arg1 arg2", CreateProcess would try
"program.exe", "program arg1.exe", then "program arg1 arg2.exe". This
behaviour is weird and not really desirable, so prevent it by always
quoting the program name.

When quoting argv[0], escape sequences shouldn't be used. msvcrt, .NET
and CommandLineToArgvW all treat argv[0] literally and end it on the
trailing quote, without processing escape sequences.
2015-01-25 17:00:10 +09:00
wm4
d8455f34c1 player: respect --untimed on last frame
The last video frame is another case that has a separate code path,
although it's pretty similar to the one in commit 73e5aa87. Fix this
in a different way, which also takes care of the last frame case,
although without context the code becomes slightly more tricky.

As further cleanup, move the decision about framedropping itself to
the same place, so the check in vo.c becomes much simpler. The check
for the vo->driver->encode flag, which is remvoed completely, was
redundant too.

Fixes #1480.
2015-01-25 17:00:10 +09:00
wm4
b0877e5454 player: respect --untimed on video format changes
If the video format changes (e.g. different frame size), a special code
path is entered to wait until the currently displayed frame is done.
Otherwise, the frame before the change would be destroyed by the
vo_reconfig() call.

This code path didn't respect --untimed; correct this.

Fixes #1475.
2015-01-25 17:00:09 +09:00
wm4
c926927c59 player: don't fall asleep on audio decoding errors
This makes it retry later.

Fixes #1474.
2015-01-25 17:00:09 +09:00
wm4
9af1ff9817 player: fix --stop-playback-on-init-failure on audio init failure
This was forgotten when the option was implemented, and makes this
option work as advertised.

Fixes #1473 (though the default behavior is probably still stupid).
2015-01-25 17:00:09 +09:00
wm4
ca34fd569d image_writer: check for conversion errors
This can happen when e.g. a VO returns a screenshot in an unsupported
format.
2015-01-25 17:00:09 +09:00
Oliver Freyermuth
4bb2da8204 cache: cache-position needs to be int64_t
Both max_filepos and offset are int64_t,
so pos can overflow, e.g. causing endless loops
in stream implementation.
2015-01-25 17:00:09 +09:00
wm4
6d7eb8346a x11: always use glXGetProcAddressARB()
glXGetProcAddress() is outdated, and as far as I know doesn't give all
the guarantees the "new" ARB function gives.

Probably doesn't matter too much, because until now it always appeared
to work. On the other hand, since this function is (bogusly) used only
on the gl3 code path, it could have happened that users hit this, and
just reverted to vo_opengl_old instead.
2015-01-25 17:00:09 +09:00
Soeren D. Schulze
cd99121185 video/out/win_state.c: fix --monitoraspect 2015-01-25 17:00:09 +09:00
wm4
392159337f manpage: document details of option quoting and escaping
Makes me realize what a mess this is. I hope it can be simplified in the
far future, preferably by killing the suboption parser completely.
2015-01-25 17:00:09 +09:00
wm4
fffd7e7a3a x11: make display-names property stricter
Returning the property before the window is mapped could lead to
confusing behavior, and in particular strange differences between
vo_vdpau and vo_opengl. (vo_opengl creates the window right at the
start, while vdpau waits until the first reconfigure event.) It might
even be possible that for vo_opengl random results were returned,
because the hidden window can have different placement than the actual,
final one on initial video reconfig.

Fix this by returning the property only if the window is considered
mapped. command.c handles this case specifically, and makes the property
unavailable, instead of returning an empty list.
2015-01-25 17:00:09 +09:00
wm4
59781d3cb3 af_volume: dump applied replaygain in verbose mode 2015-01-25 17:00:09 +09:00
Ryan Jacobs
4a6cb85993 manpage: talk about one script, not multiple scripts
There aren't multiple scripts. We're just talking about one: youtube-dl.

Signed-off-by: wm4 <wm4@nowhere>
2015-01-25 17:00:09 +09:00
wm4
74a3d29f21 command: make empty vf-metadata not an error
If a filter exists, but has no metadata, just return success. This
allows the user to distinguish between no metadata available, and filter
not inserted.

See #1408.
2015-01-25 17:00:09 +09:00
wm4
07acf5cb9a vf: fix crash if filter doesn't provide control entrypoint
This input command crashed:

    vf add @mf:format=yuv420p ; show_text "${vf-metadata/mf}"

Fixes #1408.
2015-01-25 17:00:09 +09:00
Stefano Pigozzi
8e1e814166 options: expand ~ for the include option
Fixes #1406
2015-01-25 17:00:09 +09:00
wm4
da21670880 player: make --shuffle/--merge-files affect runtime loaded playlists
Until now, these options took effect only at program start. This could
be confusing when e.g. doing "mpv list.m3u --shuffle". Make them always
take effect when a playlist is loaded either via a playlist file, or
with the "loadlist" command.
2015-01-25 17:00:08 +09:00
wm4
2cac69f221 sub: reset sub decoder correctly when cycling subtitles
reset_subtitles() works in mpctx->d_sub[], which is set to NULL before
calling it from uninit_sub(). This fixes resetting the subtitle when
cycling subtitle tracks.

Actually, this was probably a feature, because it's annoying if
subtitles don't show up when cycling them. But it also can have
unintended consequences, so get rid of it.
2015-01-25 17:00:08 +09:00
wm4
99cca56a99 vo_opengl, x11: make legacy context warning not an error
Really, this doesn't actually matter. It's printed as error only because
it was once thought to be an mostly unneeded fallback, but it turned out
this is still frequently needed, and users are getting confused.
2015-01-25 17:00:08 +09:00
wm4
676457256a vo_opengl: fix broken rejection of extended scaling
Possibly explains why some users got mysterious FBO errors on crappy
hardware.
2015-01-25 17:00:08 +09:00
wm4
7368d8f353 lua: don't ignore key press events for script key bindings
Meh.
2015-01-25 17:00:08 +09:00
wm4
2c9e0c0a29 m_option: never return NOPTS value as number from properties
MP_NOPTS_VALUE (basically INT64_MIN) is basically an special timestamp
value that means "unset" or "unknown". Its exact value is internal, and
should never be returned or interpreted by any API.

So return "no" instead (what is also what the parser accepts).
2015-01-25 17:00:08 +09:00
wm4
8d3259a391 client API: fix log buffer overflow case
It just crashed. The prefix and text fields point to static strings in
this case. Oops.

Fixes the issue mentioned in #838.
2015-01-25 17:00:08 +09:00
wm4
faf561c4ec mp_image: reject invalid display aspect ratio
Having any of these set to 0 makes no sense.

I think some code might still be using 0/0 aspect ratio to signal unset
aspect ratio, but I didn't find it. If there is still code like this, it
should be fixed instead.

Fixes #1467.
2015-01-25 17:00:08 +09:00
wm4
8c54b56f43 player: fix crash wtih --secondary-sid
Fises #1463.
2015-01-25 17:00:08 +09:00
wm4
a44ffb729b bstr: fix possible undefined behavior with length 0 strings
BSTR_P() passes the string length and start pointer to printf-like
functions. If the lenfth is 0, the pointer can be NULL, but we're
actually still not allowed to pass a NULL pointer in any case.

This is mostly a technically, because nobody in their right mind would
attempt to specifically break such cases. But it's still undefined
behavior, and some libcs might be strict about this.
2015-01-25 17:00:08 +09:00