Commit Graph

38301 Commits

Author SHA1 Message Date
wm4 6f20d6b74e lua: fix compilation with lua 5.2
Commit e2e450f9 started making use of luaL_register(), but OF COURSE
this function disappeared in Lua 5.2, and was replaced with a 5.2-only
alternative, slightly different mechanism.

So just NIH our own function. This is actually slightly more correct,
since it forces the user to call "require" to actually make the module
visible for builtin C-only modules other than "mp". Fix autoload.lua
accordingly.
2014-05-26 21:59:29 +02:00
Martin 9c18a920ff command: add write_watch_later_config command
Closes #808.

Signed-off-by: wm4 <wm4@nowhere>
2014-05-26 21:59:17 +02:00
wm4 0e1ab2a8da autoload.lua: fix autoloading of files to prepend
This used the wrong index variable, and thus didn't work.
2014-05-25 20:17:03 +02:00
wm4 2309bb91cc DOCS/coding-style: add a hint that new features should be documented 2014-05-25 19:52:51 +02:00
wm4 fea1bad856 TOOLS: add a Lua script to autoload playlist entries
This will load other files in the same directory when a single file is
played. It's an often requested feature, but we definitely don't want it
in the core.
2014-05-25 19:52:26 +02:00
wm4 e2e450f961 lua: add some filesystem utility functions
We need this only because Lua's stdlib is so scarce. Lua doesn't intend
to include a complete stdlib - they confine themselves to standard C,
both for portability reasons and to keep the code minimal. But standard
C does not provide much either.

It would be possible to use Lua POSIX wrapper libraries, but that would
be a messy (and unobvious) dependency. It's better to implement the
missing functions ourselves, as long as they're small in number.
2014-05-25 19:51:11 +02:00
wm4 e648f7e783 manpage: lua: cosmetic changes to mp.options section 2014-05-25 19:43:25 +02:00
wm4 9d0e5f6da6 playlist: fix playlist_move on itself
A playlist_move command that moves an entry onto itself (both arguments
have the same index) should do nothing, but it did something broken. The
underlying reason is that it checks the prev pointer of the entry which
is temporarily removed for moving.
2014-05-25 19:42:51 +02:00
wm4 ba1447822c vf_vdpaupp: cosmetics: rename function 2014-05-25 16:01:33 +02:00
Tsukasa OMOTO 0304c4f92d osxbundle: fix recursion termination
Prevents the binary from being copied over to the lib directory.
2014-05-25 07:42:40 +02:00
ChrisK2 30fc1a42be osc: fix chapter list display
also fix small typo in DOCS
2014-05-24 17:47:31 +02:00
wm4 7cc48f26e0 build: disable cdda and vcd by default
Let's see if anyone complains. cdda is relatively inoffensive, but the
vcd code is the definition of ifdef-hell.
2014-05-24 17:09:29 +02:00
wm4 f5eb209ce9 stream_cdda: fix compilation
See previous commit. Sigh...
2014-05-24 17:07:13 +02:00
wm4 e47e818356 stream_smb: fix compilation
Accidentally forgotten in commit a4d487.
2014-05-24 17:00:30 +02:00
wm4 01c3847b80 client API: fix mpv_observe_property with MP_FORMAT_NONE
It returned only 1 change event (after registration), and then went
silent. This was accidentally broken some time ago.
2014-05-24 16:17:52 +02:00
wm4 6125ba613f video: add --video-rotate option for controlling auto-rotation 2014-05-24 16:17:52 +02:00
wm4 8665f78018 stream_file: readjust some windows ifdeffery
Also sneak in some cosmetics.

setmode() exists on Windows/msvcrt only, so there's no need for a
config test.

I couldn't reproduce the problem with seekable pipes on wine, so axe
it. (I'm aware that it still could be an issue on real Windows.)
2014-05-24 16:17:52 +02:00
wm4 aa87c143cb stream: remove chaos related to writeable streams
For some reason, we support writeable streams. (Only encoding uses that,
and the use of it looks messy enough that I want to replace it with FILE
or avio today.)

It's a chaos: most streams do not actually check the mode parameter like
they should. Simplify it, and let streams signal availability of write
mode by setting a flag in the stream info struct.
2014-05-24 16:17:52 +02:00
wm4 80cbb3bac2 stream_lavf: remove redundant message prefixes 2014-05-24 16:17:51 +02:00
wm4 a4d487f5b2 stream: don't use end_pos
Stop using it in most places, and prefer STREAM_CTRL_GET_SIZE. The
advantage is that always the correct size will be used. There can be no
doubt anymore whether the end_pos value is outdated (as it happens often
with files that are being downloaded).

Some streams still use end_pos. They don't change size, and it's easier
to emulate STREAM_CTRL_GET_SIZE using end_pos, instead of adding a
STREAM_CTRL_GET_SIZE implementation to these streams.

Make sure int64_t is always used for STREAM_CTRL_GET_SIZE (it was
uint64_t before).

Remove the seek flags mess, and replace them with a seekable flag. Every
stream must set it consistently now, and an assertion in stream.c checks
this. Don't distinguish between streams that can only be forward or
backwards seeked, since we have no such stream types.
2014-05-24 16:17:51 +02:00
wm4 e3c20bf350 stream: kill start_pos, remove --sb option
stream.start_pos was needed for optical media only, and (apparently) not
for very good reasons. Just get rid of it.

For stream_dvd, we don't need to do anything. Byte seeking was already
removed from it earlier.

For stream_cdda and stream_vcd, emulate the start_pos by offsetting the
stream pos as seen by the rest of mpv.

The bits in discnav.c and loadfile.c were for dealing with the code
seeking back to the start in demux.c. Handle this differently by
assuming the demuxer is always initialized with the stream at start
position, and instead seek back if initializing the demuxer fails.

Remove the --sb option, which worked by modifying stream.start_pos. If
someone really wants this option, it could be added back by creating a
"slice" stream (actually ffmpeg already has such a thing).
2014-05-24 16:17:50 +02:00
wm4 3316cf5f9b player: don't init/uninit terminal at runtime
This seems like an unnecessary complication.
2014-05-24 16:17:50 +02:00
wm4 6ca8a67f96 timer: remove unneeded time_t overflow check
This is mostly covered by the OSX workaround, if the timeout is very
high. It also means that with systems using 32 bit time_t, the time will
overflow 2036 already, instead of 2037, but we don't consider this a
problem.
2014-05-24 16:17:45 +02:00
Alessandro Ghedini cec9613505 manpage: update references to renamed options 2014-05-23 21:14:22 +02:00
wm4 76bd701a7a x11: un-inline GNOME layer stuff
Having it as separate function is not useful.

Also remove the useless vo_window parameter.
2014-05-23 20:59:36 +02:00
wm4 e2e318a213 x11: prefer NetWM hints over _WIN_LAYER for --ontop
_WIN_LAYER is apparently an old GNOME thing (also explains why there is
a function vo_x11_get_gnome_layer() involved in this code). Prefer the
NetWM hints over this. This just moves the NetWM case if-body over the
_WIN_LAYER one.
2014-05-23 20:59:36 +02:00
wm4 8033b4b4ba x11: rename identifiers using reserved namespace
You can't use identifiers starting with "_" and an uppercase letter in
application programs. They are reserved by the C standard.

Unrelated change: drop unused/misleading vo_wm_NETWM define.
2014-05-23 20:59:06 +02:00
wm4 990888f968 x11: fix NetWM ontop setting
I can only assume the old code was wrong. EWMH does not document
anything with _WIN_LAYER. Instead, you have to toggle the state using a
client message. We also remove these weird non-sense fallbacks, like
using _NET_WM_STATE_BELOW - what the hell?
2014-05-23 20:57:26 +02:00
wm4 7163bf7db8 x11: add a generic function for NetWM state setting
And use it for fullscreening. It will also be used for fixing --ontop.
2014-05-23 20:57:21 +02:00
wm4 436b9a2258 old-build: fix building with libquvi4 2014-05-23 16:04:17 +02:00
wm4 e29e567f07 old-makefile: add options.lua
Also, make use of generic rules.
2014-05-23 15:58:51 +02:00
ChrisK2 ce69afab44 lua/osc: forgot some changed files in previous commit 2014-05-23 13:24:27 +02:00
ChrisK2 c6915d7325 lua/osc: small overhaul
Small fixes for the OSC, seektooltip now enabled by default.

Option-parser now moved to separate package, can be used from
other scripts, see DOCS/man/en/lua.rst.

OSC config file location moved to lua-settings/osc.conf
2014-05-23 13:14:17 +02:00
wm4 b69d57ebe8 timer: workaround for crappy operating systems
Some operating systems apparently can't deal with really long timeouts
in pthread_cond_timedwait(). Passing a time about 300000 in the future
makes the call return immediately. (tv_sec/time_t doesn't overflow in
this situation.) Reduce the wait time to about 100 days, which seems
to work fine.

The list of affected OSes follows: OSX
2014-05-23 00:20:57 +02:00
wm4 2e6b0b4ee4 timer: fix previous commit
Sigh... of course the type of the (?:) exprsssion is double, so
INT64_MAX was converted to double, which is a problem.
2014-05-22 22:50:39 +02:00
wm4 c9b68957c9 timer: improve overflow checks
Probably more correct and better readable. Although the special-casing
of 0x1p63 is weird in terms of readability (the value itself is
INT64_MAX+1, so it's already outside of range, but INT64_MAX is not
exactly representable with double precision).
2014-05-22 22:36:42 +02:00
wm4 cb2e784c07 player: give quit_watch_later an exit code argument like quit
The quit command has an optional argument that is used as exit code.
Extend that to the quit_watch_later command. Actually, unify the
implementations of the two commands.

Requested in #798.
2014-05-22 21:28:20 +02:00
Yomi0 aca4f9f474 tl_mpv_edl: correct misspelling on line 233
Closes #783

Signed-off-by: wm4 <wm4@nowhere>
2014-05-22 20:59:31 +02:00
wm4 d31b594f77 timer: fix (usually impossible) timespec.tv_sec overflow
This usually can't happen, because even if time_us (first input value)
is INT64_MAX, the value added to tv_sec will be about 2^43, and tv_sec
will be <2^31, far below a possible overflow in 64 bits. But should
time_t be 32 bits (32 bit Linux/Windows?), an overflow could happen.
2014-05-22 20:59:31 +02:00
wm4 7b7e15a460 vdpau: move RGB surface management out of the VO
Integrate it with the existing surface allocator in vdpau.c. The changes
are a bit violent, because the vdpau API is so non-orthogonal: compared
to video surfaces, output surfaces use a different ID type, different
format types, and different API functions.

Also, introduce IMGFMT_VDPAU_OUTPUT for VdpOutputSurfaces wrapped in
mp_image, rather than hacking it. This is a bit cleaner.
2014-05-22 20:59:31 +02:00
wm4 dbed21cde4 vo_vdpau: always allocate the black pixel
black_pixel is an (apparently necessary) 1x1 black surface used for
clearing the screen. It was allocated in RGB mode only, but is sometimes
used in YUV mode too.
2014-05-22 20:55:05 +02:00
wm4 52ff1cf313 old-configure: we accidentally used bash features
In at least 2 places, we want to "shift" positional parameters by a
certain amount, or remove all parameters if there are fewer parameters.
bash handled this just fine, but dash vomits upon it. POSIX shell allows
both behaviors, so we have to fix it.

Fix a comparison done with "==" instead of "=".
2014-05-22 20:54:57 +02:00
wm4 d45b68b938 player: fix cover art sometimes "syncing" against audio
Cover art is treated like video, but is not really video. In one case,
the audio sync code was accidentally still active. Fixes cover art
playback with --ao=null. (This is due to ao_null's latency emulation.
Although it's not very clear whether that is actually correct...)
2014-05-22 20:54:50 +02:00
wm4 85a513abdf player: suggest --no-audio-display on cover art 2014-05-22 13:51:31 +02:00
wm4 2f2b3f8d5c video: fix display of cover art with vo_vdpau
vo_vdpau currently has a video queue larger than 1 entry, which causes
the video display code to never queue display the video frame. This is
because we consider cover art an endless stream of frames decoded from
the same source packet, and include special logic to actually only
decode and display 1 frame.

Also, make decode_image() also signal EOF in the cover art case.
2014-05-22 13:50:10 +02:00
wm4 b37e3cc0ee cache: be silent if no initial fill is requested
Hides the "Cache fill:" message with default settings.
2014-05-22 13:07:18 +02:00
wm4 d62dad55ef edl: use start PTS of the source files as default start time 2014-05-22 13:04:36 +02:00
Jerome Leclanche 3d065a53fc x11: fix a warning with --disable-xext
Signed-off-by: wm4 <wm4@nowhere>
2014-05-22 09:29:56 +02:00
wm4 fcdaaa203b build: "tv-v4l2" needs "tv"
Fixes #795.
2014-05-22 09:29:41 +02:00
wm4 46cb1b7c45 vo: minor simplifications 2014-05-22 09:28:39 +02:00