Commit Graph
39870 Commits
Author SHA1 Message Date
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
wm4 947a791992 player: don't set tag strings to NULL
bstr is a bounded string type, consisting of a pointer and a length
value. If the length is 0, the pointer can be NULL. This is somewhat
logical due to how this abstraction works, but it can leak when
converting to C strings.

talloc_strndup() returns NULL instead of "" in this case, which broke
some other code. Use bstrto0() instead, which is the "proper" function
to convert bstr to char*.

Fixes #1462.
2015-01-25 17:00:08 +09:00
wm4 42f82c5ccf demux_mkv: fix EBML parsing checks
Reading IDs must be checked too. This was basically forgotten in commit
f3a978cd. Also set the *length parameter for ebml_parse_length() in some
error cases, which _really_ should happen.

Fixes #1461.
2015-01-25 17:00:08 +09:00
wm4 1a3a52ea25 tl_matroska: fix minor memory leak in error case
Going the way of least resistance. Fixes #1460.
2015-01-25 17:00:08 +09:00
wm4 77d5aa56b3 player: check sufficient track selection before destroying VO
mpv needs at least an audio or video track to play something. If the
track selection is basically insufficient, the player will immediately
skip to the next file (or quit).

One slightly annoying thing might be that trying to play a subtitle file
will close the VO window, and then go to the next file immediately (so
"mpv 1.mkv 2.srt 3.mkv" would flash the video window when 2.srt is
skipped). Move the check to before the video window is possibly closed.

This is a minor cosmetic issue; one can use --force-window to avoid
closing the video window at all.

Fixes #1459.
2015-01-25 17:00:08 +09:00
wm4 1f795b6172 demux_mkv: better check for some EBML parsing
Apparently, originally this code was meant to be able to read past the
buffer somewhat, which is why the buffer allocation was padded by 8
byte. This is unclean and confuses valgrind. This probably could have
crashed with certain invalid files too.

Also revert the change added with 10a2f69; it should be not needed
anymore.
2015-01-25 17:00:08 +09:00
wm4 22a06b0e81 demux_mkv: avoid endless loop with broken files
Fixes #1457.
2015-01-25 17:00:07 +09:00
wm4 f551da2cfb ao_pulse: exit AO if stream fails
This can for example reproduced by killing the pulseaudio server. If
this happens, just try to reload the AO, instead of breaking everything
forever.
2015-01-25 17:00:07 +09:00
wm4 ac06ba0aec demux_mkv: improve robustness against broken libavcodec parsers
The VP9 codec parser has a bug: it doesn't set the data/size pointers
passed to it. As I understand, it must always do this, and in fact, if
it doesn't some libavcodec generic code would be in trouble too.

This helps with #1448, but is not the full fix for it. The codec parser
must be fixed in libavcodec itself.
2015-01-25 17:00:07 +09:00
wm4 99dc774dbb ao: remove coreaudio_exclusive from autoprobing list
Apparently this was a mistake.
2015-01-25 17:00:07 +09:00
xylosper 83d44a4f6a gl_video.c: invalidate image_params in uninit_video()
When the given mp_image_params does not match with that of gl_video,
gl_video_config() always calls uninit_video() but calls init_video()
only if valid format is given.

Since uninit_video() does not change image_params of gl_video,
when the same params as the previous one is given to gl_video_config()
after gl_video is unitialized with invalid format, gl_video_config()
never calls init_video().

To prevent this, invalidate image_params of gl_video in uninit_video().
2015-01-25 17:00:07 +09:00
James Ross-Gowan 6609f68691 dxva2: copy mp_image attributes to sw_img 2015-01-25 17:00:07 +09:00
James Ross-Gowan e2beeffb92 mp_image: copy missing attributes
This adds a couple of missing fields to mp_image_copy_attributes so
things like rotation metadata work.
2015-01-25 17:00:07 +09:00
wm4 704c24776a video: fix timeline with some container formats
Using edl or --merge-files with .avi files didn't work, because the DTS
was not offset. Only the PTS was adjusted, which led to nonsense
timestamps.
2015-01-25 17:00:07 +09:00
wm4 cc32aa436e sd_lavc: apply fallback to video resolution only for vobsubs
Commit 87c13de6 added a fallback to video resolution if the subtitle
resolution is unknown. Apparently this fixed some broken files with
vobsubs.

This broke some DVB subtitles. Apparently .ts captures with 1920x1080
video resolution and 720x576 subtitles do exist. The sample at hand had
some streams with 720x576 resolution and no sub resolution set, and some
streams with 1920x1080 resolution and sub resolution set (both against
the same 1920x1080 video). My conclusion is that 720x576 is the only
reasonable fallback for DVB (but I can't be sure).

The fallback is removed for PGS too. I don't know about the PGS case; it
seems the sub resolution must always be set, so it shouldn't matter.

Fixes #1425.
2015-01-25 17:00:07 +09:00
wm4 57f149e26a options: don't cut off long options in --list-options
This was by design, so that overly long options don't mess up the column
layout, but I guess it doesn't have much worth.

Fixes #1426.
2015-01-25 17:00:07 +09:00
wm4 a77fec7547 manpage: fix --video-unscaled description
This was changed a long time ago in commit 37319ab6.
2015-01-25 17:00:07 +09:00
wm4 18c8d60b54 ytdl: silence "succeeded" message
Pretty useless by now.
2015-01-25 17:00:07 +09:00