1
mirror of https://github.com/mpv-player/mpv synced 2024-08-04 14:59:58 +02:00
Commit Graph

36287 Commits

Author SHA1 Message Date
wm4
b7f01957ec network: add options to control TLS verification 2013-09-27 18:09:30 +02:00
wm4
b8382aabb3 vaapi: make vaDeriveImage() less verbose
This can just be not supported, so making it look like a real error
doesn't make much sense.
2013-09-27 18:00:03 +02:00
wm4
0901fc8e0e vaapi: check image format in va_surface_upload()
Just for robustness. Also print a warning in vo_vaapi if this happens.
2013-09-27 18:00:03 +02:00
wm4
4d2f354da6 vaapi: potentially make reading surfaces back to system RAM faster
Don't allocate a VAImage and a mp_image every time. VAImage are cached
in the surfaces themselves, and for mp_image an explicit pool is
created. The retry loop runs only once for each surface now.

This also makes use of vaDeriveImage() if possible.
2013-09-27 17:59:44 +02:00
wm4
ede652774e input: translate mouse position to OSD space early
Until now, mouse positions were just passed to the core as-is, even if
the mouse coordinates didn't map to any useful coordinate space, like
OSD coordinates. Lua scripting (used by the OSC, the only current user
of mouse input) had to translate mouse coordinates manually to OSD space
using mp_get_osd_mouse_pos(). This actually didn't work correctly in
cases mouse coordinates didn't map to OSD (like vo_xv): the mouse
coordinates the OSC got were correct, but input.c was still expecting
"real" mosue coordinates for mouse areas.

Fix this by converting to OSD coordinates before passing the mouse
position to the core.
2013-09-27 15:39:28 +02:00
wm4
3871024ec3 input: handle MOUSE_LEAVE specially
Do this so that MOUSE_LEAVE can't be combined with other keys. (E.g.
keep 'w' pressed, then move the mouse outside of the mpv window; it will
print a warning what w-MOUSE_LEAVE is not mapped.)
2013-09-27 15:33:47 +02:00
wm4
0d90dd07ff input: more mp_msg conversion
It appears the last run missed all mp_tmsg().

Since the command parser also prints messages, it needs a new parameter
to pass a log context. We go the easy way and just require the input_ctx
to be passed, and use its mp_log.
2013-09-27 15:30:59 +02:00
Ben Boeckel
9f149717a6 matroska: prevent uids from being dereferenced when NULL
The old code prevented it since uids being NULL makes a 0 talloc length.
Now that we're iterating over a specific length, NULL can be
dereferenced.
2013-09-27 08:45:02 +02:00
ChrisK2
2970352b25 osc: Prevent OSD style options from messing with the OSC styles
Should fix #259
2013-09-26 18:29:14 +02:00
Ben Boeckel
828a952c9a matroska: fix uninitialized memory accesses with ordered chapters
There is uninitialized memory access if the actual size isn't passed
along. In the worst case, this can cause a source to be loaded against
the uninitialized memory, causing a false count of found versus required
sources, preventing the "Failed to find ordered chapter part" message.
2013-09-26 18:20:32 +02:00
wm4
696a8c5609 osd_libass: add "Default" dummy style
This is pretty much a hack for the OSC. It will allow it to rely on a
somewhat predictable style, instead of having to overwrite all user
OSD settings manually with override tags.
2013-09-26 17:49:54 +02:00
wm4
5a837ced0b video: let sh_video->disp_w/h always be container size
Nothing really accesses it. Subtitle initialization actually does in a
somewhat meaningful way, but there container size is probably fine, as
subtitles were always initialized before the first video frame was
decoded.
2013-09-26 17:33:57 +02:00
wm4
9a55c4e70c video: let sh_video->aspect always be container aspect ratio
Now writing -1 to the 'aspect' property resets the video to the auto
aspect ratio. Returning the aspect from the property becomes a bit more
complicated, because we still try to return the container aspect ratio
if no frame has been decoded yet.
2013-09-26 17:29:14 +02:00
wm4
f5bf6c0fb3 vd: move aspect calculation to a function
This function would probably be useful in other places too.

I'm not sure why vd.c doesn't apply the aspect if it changes size by
less than 4 pixels. Maybe it's supposed to avoid ugly results with bad
scalers if the difference is too small to be noticed normally.
2013-09-26 16:09:08 +02:00
wm4
7eb13c4028 vd: remove some dead code
As of now, this function is called only after decoding a full, valid
video frame, so the image parameters should be reliable.
2013-09-26 15:54:58 +02:00
ChrisK2
0a0d7f43a5 Add the on-screen-controller
Signed-off-by: wm4 <wm4@nowhere>
2013-09-26 01:29:15 +02:00
wm4
6048f87e3c Add initial Lua scripting support
This is preliminary. There are still tons of issues, and any aspect
of scripting may change in the future. I decided to merge this
(preliminary) work now because it makes it easier to develop it, not
because it's done. lua.rst is clear enough about it (plus some
sarcasm).

This requires linking to Lua. Lua has no official pkg-config file, but
there are distribution specific .pc files, all with different names.
Adding a non-pkg-config based configure test was considered, but we'd
rather not.

One major complication is that libquvi links against Lua too, and if
the Lua version is different from mpv's, you will get a crash as soon
as libquvi uses Lua. (libquvi by design always runs when a file is
opened.) I would consider this the problem of distros and whoever
builds mpv, but to make things easier for users, we add a terrible
runtime test to the configure script, which probes whether libquvi
will crash. This is disabled when cross-compiling, but in that case
we hope the user knows what he is doing.
2013-09-26 01:28:58 +02:00
wm4
b0cc3c2cf4 Fix previous commit
This time it broke because I didn't actually test compiling vo_vaapi.c,
and it was using a macro from mp_image.h, which implicitly assumed
FFALIGN was available. Screw that too, and copy the definition of
ffmpeg's FFALIGN to MP_ALIGN_UP, and move these macros to mp_comnon.h.
2013-09-25 22:44:12 +02:00
wm4
200fb7eceb vaapi: fix compilation with Libav
The code using FFSWAP was moved from vo_vaapi.c to vaapi.c, which didn't
include libavutil/common.h anymore, just libavutil/avutil.h. The header
avutil.h doesn't include common.h recursively in Libav, so it broke
there.

Add FFSWAP as MPSWAP in mp_common.h (copy pasted from ffmpeg) to make
sure this doesn't happen again. (This kind of stuff happens all too
often, so screw libavutil.)
2013-09-25 22:22:02 +02:00
wm4
72fbd846db options: allow selecting the libass shaper
I'm using the word "languages" instead of "scripts" in the manpage, but
I think that's easier to understand with a smaller amount of
descriptions.
2013-09-25 21:42:29 +02:00
wm4
1e4f08c50c options: make --ass-hinting a choice, instead of using magic numbers
options.c still doesn't use the constants defined by the libass headers,
but it's still better than exposing those to the user directly.
2013-09-25 21:40:35 +02:00
Martin Herkt
4e6751609e configure: make the pdflatex check use the tempdir 2013-09-25 16:04:41 +02:00
Martin Herkt
cc12f05a52 configure: improve pdflatex check 2013-09-25 15:57:20 +02:00
wm4
641e94cd27 vaapi: allow GPU read-back with --hwdec=vaapi-copy
This code is actually quite inefficient: it reuses the (slow, simple)
screenshot code. It uses an inefficient method to read the image
(vaGetImage() instead of vaDeriveImage()), allocates new memory for
each frame that is read, and it tries all image formats again each
time.

Also, in my tests it always picked NV12 as image format, which is not
ideal if you actually want to filter the video, and vo_xv can't handle
this format without conversion either.

However, a user confirmed that it worked for him, so everything is fine.
2013-09-25 13:53:42 +02:00
wm4
7c3f1ffc44 vd_lavc: allow process_image to change image format
This will allow GPU read-back with process_image.

We have to restructure how init_vo() works. Instead of initializing the
VO before process_image is called, rename init_vo() to
update_image_params(), and let it update the params only. Then we really
initialize the VO after process_image.

As a consequence of these changes, already decoded hw frames are
correctly unreferenced if creation of the filter chain fails. This
could trigger assertions on VO uninitialization, because it's not
allowed to reference hw frames past VO lifetime.
2013-09-25 13:53:42 +02:00
xylosper
39d1ab82e5 vaapi: add vf_vavpp and use it for deinterlacing
Merged from pull request #246 by xylosper. Minor cosmetic changes, some
adjustments (compatibility with older libva versions), and manpage
additions by wm4.

Signed-off-by: wm4 <wm4@nowhere>
2013-09-25 13:53:42 +02:00
wm4
1ee8d0210d sd_ass: minor simplification
There shouldn't be any functional changes. Just reduce the amount of
pointless temporary variables.
2013-09-24 23:18:11 +02:00
wm4
1dbb73e0fb sd_ass: remove dead code
This code was made inactive some months ago. At this time it wasn't
entirely clear whether this code was still needed, but now I'm pretty
sure it isn't. Even if it is, it didn't work anymore.
2013-09-24 23:14:38 +02:00
wm4
fdd5140f43 command: fix short buffer when handling of long property names
This wasn't enough and could lead to a cut off message shown on OSD.
Just make it dynamic, since we already use dynamic memory allocation
at this point anyway.
2013-09-24 21:26:05 +02:00
Alexander Preisinger
d75cfef49c wayland: remove outdated comment 2013-09-24 18:34:50 +02:00
Alexander Preisinger
3308bc2bc9 wayland: remove moving window by grabbing
Moving the window was convenient but generates a MOUSE_LEAVE event
which it shouldn't. Now we remove it, because it is still possible
to move the window in weston with MOD+BTN0.
2013-09-24 18:30:44 +02:00
Martin Herkt
d4bdcdfe09 .gitignore: add pdflatex output files 2013-09-23 19:07:22 +02:00
Martin Herkt
8764f4cf96 sub/ass_mp: remove superfluous message prefixes 2013-09-23 19:02:23 +02:00
Martin Herkt
3807038193 install: don’t force append /mpv to docdir 2013-09-23 14:09:15 +02:00
wm4
ee57f7fdae win32: edit resource files, in particular set CompanyName
Setting CompanyName (probably) helps with issue #256.

Update some other fields as well, because why not. (They're full of
MPlayer remnants.)
2013-09-23 01:44:09 +02:00
wm4
ddca41bd54 demux: don't print "Clip info:" line if there are no tags 2013-09-23 01:22:48 +02:00
Paul B Mahol
20b2d7cb6f ao_oss: add support for SNDCTL_DSP_RESET and use it when pausing
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: wm4 <wm4@nowhere>
2013-09-23 01:21:37 +02:00
wm4
cc7f8ee620 mplayer: attempt to make playback resume work with DVD/BD
The problem with DVD/BD and playback resume is that most often, the
filename is just "dvd://", while the actual path to the DVD disk image
is given with --dvd-device. But playback resume works on the filename
only.

Add a pretty bad hack that includes the path to the disk image if the
filename starts with dvd://, and the same for BD respectively. (It's a
bad hack, but I want to go to bed, so here we go. I might revert or
improve it later, depending on user feedback.)

We have to cleanup the global variable mess around the dvd_device.
Ideally, this should go into MPOpts, but it isn't yet. Make the code
paths in mplayer.c take MPOpts anyway.
2013-09-22 03:31:25 +02:00
wm4
b0f7a26f1a network: fix rtsp playback
By default, libavformat uses UDP for rtsp playback. This doesn't work
very well. Apparently the reason is that the buffer sizes libavformat
chooses for UDP are way too small, and switching to TCP gets rid of this
issue entirely (thanks go to Reimar Döffinger for figuring this out).

In theory, you can set buffer sizes as libavformat options, but that
doesn't seem to help.

Add an option to select the rtsp transport, and make TCP the default.

Also remove an outdated comment from stream.c.
2013-09-22 02:40:29 +02:00
wm4
ce861c9f33 stream_lavf: print lavf options that could not be set
Mainly for debugging. Usually, we just set options for all possible
protocols, and we can't really know whether a certain protocol is used
beforehand. That's also the reason why avio_open2() takes a dictionary,
instead of letting the user set options directly with av_opt_set(). Or
in other words, we don't know whether an option that could be set is an
error or not, thus we print the messages only at verbose level.
2013-09-22 02:20:18 +02:00
wm4
eda596a3f9 command: when changing volume while muted, show an extra message on OSD
So nobody has to wonder why everything is silent, even if they raise the
volume.
2013-09-21 00:08:38 +02:00
wm4
897d4b58a1 command: when changing a property, allow showing an extra OSD message
This is for properties that normally show a bar, and thus do not show an
OSD message (as per classic mplayer behavior). Setting an extra_msg
allows showing an OSD message anyway, except if OSD messages are
explicitly suppressed.

This refactors the whole show_property_osd() function a bit, and
replaces the weird sep field with a more general method.
2013-09-21 00:07:42 +02:00
wm4
f988c63003 m_property: add a way to switch on property values in property expansion
Allows for example: --status-msg='${?pause==yes:(Paused) } ...' to
emulate the normal terminal status line. It's useful in other situations
too.

I'm a bit worried about extending this mini-DSL, and sure hope nobody
will implement a generic formula evaluator at some point in the future.
But for now we're probably safe.
2013-09-20 23:09:43 +02:00
wm4
ab706f9969 m_property: rearrange code 2013-09-20 22:26:08 +02:00
wm4
99576ac483 command: don't append, but prepend deinterlace filter by default
In most cases, it's better if deinterlacing happens before any other
filtering, so prepend the filter to the user's filter list, instead
of appending it.
2013-09-20 16:48:08 +02:00
wm4
d5a3739105 vo_lavc: mp_msg conversion
Also restores consistent log message prefixes with ao_lavc.
2013-09-20 16:32:36 +02:00
wm4
0611c43b97 command: use a list of potential deinterlacer filters
Instead of hardcoding a single filter. This might be helpful for
modeling the vaapi deinterlacer as a video filter. The idea is that a
software deinterlacer would be tried first, and if that fails (because
vaapi hardware decoding uses HW surfaces, which a software deinterlacer
does not accept), the vaapi filter would be tried.
2013-09-20 15:09:29 +02:00
wm4
2694b5f378 vo/x11_common: don't require a working input method
Normally, we need this for Xutf8LookupString(). But we can just fall
back to XLookupString(). In fact, the code for this was already there,
the code was just never tested and was actually crashing when active
(see commit 2115c4a).
2013-09-20 14:45:49 +02:00
wm4
6c28524e0f vf: fix filter initialization error check
vf_open returns 0 on error, 1 on success. Oops. Accidentally broken
with 6629a95.
2013-09-20 14:01:00 +02:00
Johan Kiviniemi
912f609403 ao_pulse: bug fix: goto the correct error handler 2013-09-20 13:50:45 +02:00