Commit Graph

37916 Commits

Author SHA1 Message Date
David Weber 750de181d7 command: add paused-for-cache, total-avsync-change, drop-frame-count properties
This is needed if you want to reimplement the status line in lua

I could only test drop-frame-count because I didn't find an easy way to
trigger paused-for-cache and total-avsync-change

Signed-off-by: wm4 <wm4@nowhere>
2014-04-13 12:32:14 +02:00
wm4 7ded55f667 vf_vapoursynth: print an error if VapourSynth returns an unknown format
Apparently there is no real format negotiation, so this can actually
happen.
2014-04-13 12:30:57 +02:00
wm4 8161f4374c vf_vapoursynth: error out early if the file sub-option is not set
Instead of crashing by possibly passing a NULL pointer to VapourSynth.
2014-04-13 12:29:40 +02:00
wm4 f3043a77a3 manpage: vf_vapoursynth: document what happens on seeking
Unfortunately, reloading on seeking causes real problems.
2014-04-13 12:27:26 +02:00
wm4 76961843c3 manpage: lua: separate "advanced" functions into a separate section
This will be less confusing.
2014-04-12 20:44:13 +02:00
wm4 f3c0897b3f lua: make it easier to integrate with foreign event loops
We provide some "official" utility functions for this.
2014-04-12 20:41:12 +02:00
wm4 19abeaf62d lua: wrap mpv_get_wakeup_pipe()
Pretty much experimental for issue #661.
2014-04-12 20:13:53 +02:00
wm4 4e5cea86c2 client API: add mpv_get_wakeup_pipe convenience function
Should make integreating with some event loops easier. Untested.
2014-04-12 20:13:07 +02:00
wm4 33f822b715 video: add VapourSynth filter bridge
Mainly meant to apply simple VapourSynth filters to video at runtime.
This has various restrictions, which are listed in the manpage.

Additionally, this actually copies video frames when converting frame
references from mpv to VapourSynth, and a second time when going from
VapourSynth to mpv. This is inefficient and could probably be easily
improved. But for now, this is simpler, and in fact I'm not sure if
we even can references VapourSynth frames after the core has been
destroyed.
2014-04-12 19:31:50 +02:00
wm4 839c3ae64b options: don't sort sub-option help output
Commit 2c2c1203 sorted the output of --list-options, but the same code
ias also used for listing sub-options, such as --vo=scale:help. For sub-
options, the order actually matters.
2014-04-12 11:38:00 +02:00
Evan Purkhiser 5cfb180a89 terminal: pretty print modules for --msgmodule 2014-04-12 11:37:53 +02:00
James Ross-Gowan 2370ef9d22 manpage: fix --vf=scale options 2014-04-11 14:12:11 +02:00
wm4 2c2c1203c3 options: sort --list-options
Until now, --list-options printed options in random order. There
literally wasn't any logic in its order, they just appeared as they were
declared. So just sort them.

Note that we can't sort them in advance, because for certain things
internal to m_config, the order actually matters.

Also we're using strcasecmp(), which is bad (locale dependent), but this
is output intended for human consumption, so it's not a problem.
2014-04-11 01:39:30 +02:00
wm4 333c8cbc29 command: remove extended information from --list-properties
This used to display the property type, but it was not always correct or
even available. The way the property mechanism works, we can know this
only at runtime.
2014-04-11 01:27:57 +02:00
wm4 86094c2c5a client API: include the reason in MPV_EVENT_END_FILE
Otherwise, the client API user could not know why playback was stopped.

Regarding the fact that 0 is used both for normal EOF and EOF on error:
this is because mplayer traditionally did not distinguish these, and in
general it's hard to tell the real reason. (There are various weird
corner cases which make it hard.)
2014-04-11 01:23:32 +02:00
wm4 d3e9f51c71 manpage: document how the client API retrieves the complicated properties
"Complicated" as in they use sub-properties, and using MPV_FORMAT_NODE
allows an application to retrieve all information at once.
2014-04-11 01:05:06 +02:00
wm4 55d6e1f98d lua: add helper function for printing a table
Although this is something really basic, Lua's standard library doesn't
provide anything like this. Probably because there are too many ways to
do it right or wrong.

This code tries to be really careful when dealing with mixed
arrays/maps, e.g. when a table has integer keys starting from 1, making
it look like an array, but then also has other keys.
2014-04-11 00:40:09 +02:00
wm4 fa35079361 client API: remove outdated comments 2014-04-11 00:12:35 +02:00
wm4 04bcb539fd encode: write 2-pass stats only per-packet
The stats were retrieved and written on every encode call, instead of
every encode call that actually returned a packet. ffmpeg.c also does it
this way, so it must be "more correct". Fixes 2-pass encoding.
2014-04-11 00:08:32 +02:00
wm4 856d2c2491 encode: add a missing \n to a log call 2014-04-10 23:58:12 +02:00
wm4 fb06e30b7b lua: add a minor helper function 2014-04-10 23:56:06 +02:00
wm4 f0c8c26e29 client API: improve comments 2014-04-10 23:53:42 +02:00
wm4 f0e08c01ff terminal-unix: reject overlong termcap strings
Our own tables have size for only 8 chars, so these sequences must be
rejected. It seems strings of length 8 are still ok, because the code
uses memcmp and not strcmp, so still allow these.

Based on mplayer-svn commit r37129.
2014-04-10 00:18:26 +02:00
reimar 39b2e20698 joystick: Fix incorrect pointer offset code.
I have some doubts that short reads are even allowed/
possible for /dev/js*, does someone know for sure?

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@37132 b3059339-0415-0410-9bf9-f77b7e298cf2
2014-04-10 00:08:08 +02:00
wm4 a20aa15969 sws_utils: remove custom GBRP conversion
We needed this because the OSD rendering path used GBRP for RGB
rendering, and not all swscale versions supported this conversion. But
recently we've dropped support for very old ffmpeg/libav versions, so
this isn't needed anymore.
2014-04-10 00:07:25 +02:00
wm4 24f1878e95 stream_dvd, cache: hack seeking with --cache + dvd:// back into working
This was broken at some unknown point (even before the recent cache
changes). There are several problems:
- stream_dvd returning a random stream position, confusing the cache
  layer (cached data and stream data lost their 1:1 corrospondence by
  position)
- this also confused the mechanism added with commit a9671524, which
  basically triggered random seeking (although this was not the only
  problem)
- demux_lavf requesting seeks in the stream layer, which resulted in
  seeks in the cache or the real stream

Fix this by completely removing byte-based seeking from stream_dvd. This
already works fine for stream_dvdnav and stream_bluray. Now all these
streams do time-based seeks, and pretend to be infinite streams of data,
and the rest of the player simply doesn't care about the stream byte
positions.
2014-04-09 23:12:31 +02:00
wm4 d6086fa9ec cache: fix description of the offset field
This field sure is a bit strange. I hope the description is correct now.
2014-04-09 22:45:55 +02:00
wm4 5131fe13e1 cache: change a define to an enum
More consistent.
2014-04-09 22:36:01 +02:00
wm4 3836bfb1ad cache: fix checks/output on initialization
resize_cache() checks the size itself and clamps the size to the valid
range if necessary, so we don't need these checks. In fact, the checks
are different. Also, output the cache size after clamping, instead of
before.
2014-04-09 22:34:58 +02:00
Nikoli 65099833f7 TOOLS: add script for using mpv with youtube-dl
Signed-off-by: wm4 <wm4@nowhere>
2014-04-09 20:41:51 +02:00
James Ross-Gowan 17d0609d1e stream_file: Check the handle for network streams
Use NtQueryVolumeInformationFile instead of GetDriveType for detecting
remote filesystems on Windows. This has the advantage of working
directly on the file handle instead of needing a path and it works
unmodified in Cygwin where the previous code wouldn't understand Cygwin
paths or symlinks.

There is some risk in using NtQueryVolumeInformationFile, since it's an
internal function and its behaviour could change at any time or it could
be removed in a future version of Windows, however it's documented[1] in
the WDK and it's used successfully by Cygwin, so it should be fine. If
it's removed, the code should fail gracefully by treating all files as
local.

[1]: http://msdn.microsoft.com/en-us/library/windows/hardware/ff567070.aspx

Signed-off-by: wm4 <wm4@nowhere>
2014-04-09 20:41:51 +02:00
wm4 217008be4a client: change equality rules for MPV_FORMAT_NONE 2014-04-09 20:27:26 +02:00
wm4 b23a1edf55 client: add a comment 2014-04-09 19:27:28 +02:00
wm4 e06d57b7f8 cache: simplify
Merge the cache_read function into cache_fill_buffer, since there's
not much reason to keep them separate. Also, simply call read_buffer()
to see if there's any readable data, instead of checking for the
condition manually.
2014-04-09 19:26:35 +02:00
wm4 5f65a5cfea cache: allow resizing at runtime
The only tricky part is keeping the cache contents, which is made simple
by allocating the new cache while still keeping the old cache around,
and then copying the old data.

To explain the "Don't use this when playing DVD or Bluray." comment: the
cache also associates timestamps to blocks of bytes, but throws away the
timestamps on seek. Thus you will experience strange behavior after
resizing the cache until the old cached region is exhausted.
2014-04-09 19:15:23 +02:00
wm4 6ac98c042f cache: minor simplification
The only difference is that the MP_DBG message is not printed anymore if
the current user read position is outside of the current cache range.

(In order to handle seek_limit==0 gracefully in the normal case of
linear reading, change the comparison from ">=" to ">".)
2014-04-09 19:07:50 +02:00
wm4 a967152498 cache: adjust stream position if necessary
Until now, this could never happen, because new data was simply always
appended to the end of the cache. But for making stream cache resizing
easier, doing it this way seems advantageous. It also makes it harder to
make the internal state inconsistent. (Before this change it could
happen that cache and stream position went out of sync if the read
position was adjusted "inappropriately".)
2014-04-09 19:06:21 +02:00
wm4 80392efaea cache: no short reads in read_buffer
Until now, cache_read() (which calls read_buffer()) could return short
reads. This was a simplification allowed by the stream interface. But
for cache resizing, it will be more practical to make read_buffer() do
a full read.
2014-04-09 19:05:41 +02:00
wm4 e7a5124b36 cache: move ringbuffer read into a separate function
No functional changes yet.
2014-04-09 19:03:23 +02:00
wm4 4c4c7bdeda cache: fix typo in comment 2014-04-09 19:03:17 +02:00
wm4 d6c4b35b0b cache: always update cached controls after running a stream control
Seems like a good idea. One possible bad effect would be slowing down
uncached controls, but they're already slow. The good thing is that
many controls make intrusive changes to the stream (at least controls
which do write accesses), so the cached parameters should be updated.
2014-04-09 19:01:32 +02:00
ChrisK2 4f689258cb osc: fix playlist display 2014-04-09 18:10:51 +02:00
wm4 83874e9429 manpage: --ad-spdif-dtshd=yes works now
It was fixed a while ago. There are still some issues, as pointed
out in the manpage addition.
2014-04-08 23:19:04 +02:00
wm4 98f5d4c30c vd_lavc: by default, do not show corrupt frames
This flips the default value. Use --vd-lavc-show-all=yes to revert.
2014-04-08 23:05:15 +02:00
Vika Apelsinova 77a2d79edb demux: add "BIKb" FourCC
More support for the worst codec ever.

Signed-off-by: wm4 <wm4@nowhere>
2014-04-08 22:59:53 +02:00
wm4 89d400dc21 client API: avoid redundant property change events if possible
This is done simply by comparing the previous and current values. Do
this only if the requested format is not MPV_FORMAT_NONE.
2014-04-08 22:06:39 +02:00
wm4 d6022f33d6 command: property set commands should send property change notifications
Some of these property implementations already send notifications on
their own, but most don't. This takes care of them.

Of course this still doesn't handle all propertry changes - this is
impossible without special-casing each property that can change on its
own.
2014-04-08 21:24:14 +02:00
wm4 a94020e25b lua: add API for observing property changes
A low level API was added already earlier, but that was merely a binding
for the raw C API. Add a "proper" one, and document it.
2014-04-08 21:10:00 +02:00
wm4 708f32b746 vo_vdpau: add an additional check for timestamp robustness
This might be a good idea in order to prevent queuing a frame too far in
the future (causing apparent freezing of the video display), or dropping
an infinite number of frames (also apparent as freezing).

I think at this point this is most of what we can do if the vdpau time
source is unreliable (like with Mesa). There are still inherent race
conditions which can't be fixed.
2014-04-08 20:16:53 +02:00
wm4 a62276bf56 vo_vdpau: document what WRAP_ADD does
This wasn't necessarily clear.
2014-04-08 19:13:15 +02:00