Commit Graph

36273 Commits

Author SHA1 Message Date
ChrisK2 dd3e52fe68 osc: Don't create a config if none exists.
A documentation explaing where and how to create one instead will follow.
2013-10-15 01:17:34 +02:00
wm4 f0a5ff39a1 osc: use "info" instead of "warn" for config file creation message
When the main mpv config file, "info" is used, so this makes things
consistent.
2013-10-14 23:48:18 +02:00
wm4 7cbb7b680c example.conf: add example for disabling the OSC 2013-10-14 23:42:53 +02:00
wm4 cf02e515d4 parser-cfg: allow putting options with leading "--"
Now you can pretend the config file is quite literally command line
values dumped into a file, e.g.

--option1=value
--option2=value
...

although the underlying mechanisms are quite different.
2013-10-14 23:41:26 +02:00
wm4 c7dee24c8c parser-cfg: use bstr everywhere after parsing stage
Until now it used both char[] and bstr variants in the same code, which
was nasty. For example, the next commit would have additionally required
using memmove() to remove the prefix from the char[] string.
2013-10-14 23:37:58 +02:00
wm4 8c234045fa options: enable OSC by default
Can can disable it with --osc=no.
2013-10-14 21:09:54 +02:00
wm4 24fffa0f6b mplayer: escape strings if needed when writing watch_later config
This fixes handling of e.g. "--vf=lavfi=[ noise ]" when used with
playback resume functionality. The spaces made it bug out, and there are
more cases where it could potentially break.

We could always escape for simplicity, but for now make old and new mpv
builds somewhat interoperable and use this new escaping only if needed.
2013-10-14 21:05:58 +02:00
wm4 5106edfd5e parser-cfg: parse % escapes
This parses "%len%string" escapes, where string can contain any
characters. This method of escaping has also been used in other parts
of mplayer and mpv, so it's not a new idea.

(Also, don't confuse with URL encoding.)

Needed by the following commit.
2013-10-14 21:04:58 +02:00
wm4 5a1b60c567 version.sh: don't use git tags for version output (again)
With the way I've been doing releases in the release/0.1 branch, this
proved completely useless. You need to write the VERSION file anyway,
and since we use github's automatically generated tarballs (via its
release system), the VERSION file needs to be in the git revision of
a release anyway. git master on the other hand displayed the v0.1.0
tag, because the tag is within the master branch.

This essentially reverts commit b27f65a. Now just print the contents
of the VERSION file if it exists, and likewise, we append the git
revision if it exists. (Do that even if VERSION exists, because this
way we can tell if someone is using the release branch at an in-between
point where no new release has been made yet.)
2013-10-14 20:14:17 +02:00
wm4 0f1764195a mplayer: print ffmpeg library versions along with mpv version info
Also change what the FFmpeg version info looks like, and additionally
dump lavfi/lavr/lswr versions. (Don't bother with libavdevice and
libpostproc, they're not important enough.)

Unfortunately, there's no "single" FFmpeg/Libav version due to fatal
braindeath on the FFmpeg/Libav side. We can't map the versions to
releases either (it simply isn't accessible anywhere).
2013-10-14 20:14:17 +02:00
ChrisK2 683da7411e osc: raise minmousemove default setting to 3 and disable input mouse area when OSC not visible
The mouse area that covers the OSC is now only activated when the OSC is actually visible, to make sure the mouse still hides if it happens to be parked in the OSC area without making the OSC show up.
2013-10-14 19:51:16 +02:00
wm4 94e71b7cc0 mplayer, vo_image: simplify OSD redrawing, fix vo_image crash
vo_image didn't handle OSD redrawing correctly anymore after OSD
redrawing behavior was changed in commit ed9295c (or maybe it has been a
problem for a longer time, and only showed up now). Basically, flip_page
was called unexpectedly and when no image was stored, which made it
crash trying to access the image. This could happen when for example
provoking OSD redrawing by pausing while using --vo=image, or by using
this command line: mpv --vo=image '-vf=lavfi="select=not(mod(n\,3))"'

Fix by removing the code that pretends vo_image can redraw OSD, and by
removing the framestepping fallback, which could make bad things happen
if the VO didn't support OSD redrawing. By now, there aren't any real
VOs that can't redraw the OSD properly, so this code is not needed and
just complicates things like vo_image.

This change likely will also be useful for vo_lavc (encoding).
2013-10-13 23:40:23 +02:00
wm4 eeac26410f mplayer: print a warning if libass is not compiled
Libass is technically an optional dependency, but in practice users
tend to disable libass accidentally or for the hell of it to get
something "minimal", without being aware of the consequences.
2013-10-13 22:25:33 +02:00
ChrisK2 1560d6ce60 osc: fix mouse hiding 2013-10-13 05:38:13 +02:00
ChrisK2 9b20c681fd osc: Once again new Show/Hide handling
The deadzone-size is now by default zero, so movement on the entire window will make the OSC show up. To avoid it showing up by randomly moving mice, the option 'minmousemove' controls how many pixels movement (default: 1) between ticks (frames) are necessary to make the OSC show up.
The deadzone can be reenabeled by setting the option 'deadzonesize' (default: 0 = no deadzone, 1 = entire area between OSC and opposite window border), to restore the old behavior, set it to ~0.92.

The OSC will hide immediately when leaving the window or entering the deadzone (if existing) or after the time specified with 'hidetimeout' (default: 500ms) passed without any new movement. Set to negative value to disabling auto-hide (thus restoring old behavior). The OSC will never hide if hovered by the mouse.
2013-10-13 03:51:25 +02:00
wm4 a550731209 Copyright, LICENSE: switch to GPL version 2 or later
Now that talloc has been removed, the license can be switched back to
GPLv2+. Actually, there never was a GPLv2+ licensed MPlayer (fork or
not) until now, but removal of some GPLv2-only code makes this possible
now. Rewrite the Copyright file to explain the reasons for the licenses
MPlayer and forks use. The old Copyright file didn't contain anything
interesting anymore, and all information it contained is available at
other places in the source tree.

The reason for the license change itself is that it should improve
interoperability with differently licensed code in general.

This essentially reverts commit 1752808.
2013-10-13 01:36:10 +02:00
wm4 0933f12d28 Replace talloc
There are multiple reasons to do this. One big reason is the license:
talloc is LGPLv3+, which forces mpv to be licensed as GPLv3+.

Another one is that our talloc copy contains modifications, which makes
it essentially incompatible with upstream talloc (in particular, our
version aborts on out of memory conditions - well, it wasn't my idea).
Updating from upstream is also a bit involved - the talloc source is
not really organized in a way to allow copying it into projects (and
this isn't an intended use-case).

Finally, talloc is kind of big and bloated. The replacement halves the
amount of code - mainly because we didn't use all talloc features. It's
even more extreme if you compare upstream talloc (~4700 lines) and the
new allocator without talloc compat (~900 lines).

The replacement provides all features we need. It also doesn't clash
with talloc. (The talloc compatibility wrapper uses macros to avoid
introducing linker-level symbols which could clash with libtalloc.)

It also tries to lower the overhead (only 4 words opposed to 10 words
in talloc for leaf nodes in release mode). Debugging features like leak
reporting can be enabled at compile time and add somewhat more overhead.
Though I'm not sure whether the overhead reduction was actually
successful: allocations with children need an "extra" header, which adds
plenty of overhead, and it turns out that almost half of all allocations
have children. Maybe the implementation could be simplified and the
extra header removed - even then, overhead would be lower than talloc's.

Currently, debugging features can be entirely deactivated by defining
NDEBUG - I'm not sure if anything defines this directly yet, though.

Unlike in talloc, the leak reporting stuff is thread-safe. (That's also
why it's far less elegant, and requires extra list pointers.)

Comes with a compatibility layer, so no changes to mpv source code
are needed. The idea is that we will pretend to be using talloc for
a while, so that we can revert to our old talloc implementation at
any time for debugging purposes.

Some inspiration was taken from Mesa's ralloc:

    http://cgit.freedesktop.org/mesa/mesa/tree/src/glsl/ralloc.h

This is another talloc replacement, but lacks some features we need
(getting size of an allocation, debugging features, being able to
access children in the dtor).

There's some information in ta/README what will happen next and how the
transition is expected to progress.
2013-10-13 01:36:09 +02:00
wm4 c613d802bc talloc: change talloc destructor signature
Change talloc destructor so that they can never signal failure, and
don't return a status code. This makes our talloc copy even more
incompatible to upstream talloc, but on the other hand this is
preparation for getting rid of talloc entirely.

(The talloc replacement in the next commit won't allow the talloc_free
equivalent to fail, and the destructor return value would be useless.
But I don't want to change any mpv code either; the idea is that the
talloc replacement commit can be reverted for some time in order to
test whether the talloc replacement introduced a regression.)
2013-10-13 01:16:30 +02:00
Stefano Pigozzi 8d5f800567 cocoa: make --ontop also cover dock+menubar
This only shows any differences when mpv isn't frontmost and is in fullscreen.
Cmd+Tab overlay is still at a higher level as to avoid complete usability fail.
2013-10-12 21:02:46 +02:00
wm4 f312528ebc command: preferably show "add"/"cycle"/"set" command errors on OSD
Before this, they were shown on terminal only. Now they use the OSD
mechanism, which shows them on the video window or the terminal,
depending on settings and what's available.
2013-10-12 18:57:02 +02:00
wm4 20988ee607 command: don't allow changing volume if no audio initialized
Changing volume when audio is disabled was a feature request (github
issue #215), and was introduced with commit 327a779.

But trying to fix github issue #280 (volume is not correct in no-audio
mode, and if audio is re-enabled, the volume set in no-audio mode isn't
set), I concluded that it's not worth the trouble and the current
implementation is questionable all around. (For example, you can't
change the real volume in no-audio mode, even if the AO is open - this
could happen with gapless audio.) It's hard to get right, and the
current mixer code is already hilariously overcomplicated. (Virtually
all of mixer.c is an amalgamation of various obscure corner cases.)

So just remove this feature again.

Note that "options/volume" and "options/mute" still can be used in
idle mode to adjust the volume used next time, though these properties
can't be used during playback and thus not in audio-only mode.

Querying the volume still "works" in audio-only mode, though it can
return bogus values.
2013-10-12 18:57:02 +02:00
wm4 38874b2f2e playlist: check for NULL on caller site
Letting some playlist functions randomly accept NULL, while others do
not isn't such a good idea.
2013-10-12 18:57:02 +02:00
Philip Sequeira 7ce464bef9 options: --loop=N means playback N times, not N+1 times
The argument or this change is that --loop should set how often the
file is played, not the number of additional repeats.

Based on pull request 277, with additions to the manpage and removal
of "--loop=0".

Signed-off-by: wm4 <wm4@nowhere>
2013-10-12 18:57:02 +02:00
wm4 d1c473bc25 libquvi9: work around insane interaction between libquvi and libkdecore
The primary effect of this commit is that it fixes playback resume if
libquvi 0.9 and German locale are used, and libkdecore is on the system.
(See github issue #279.)

libquvi uses libproxy to determine system-wide proxy settings. libproxy
in turn loads libkdecore (if present) to determine KDE proxy settings.
libkdecore has a global constructor, which calls setlocale(LC_ALL, ""),
switching the current locale from "C" to what the user's settings. This
breaks some basic C string processing functions. Note that the locale
won't be set on program start, but only when libproxy calls dlopen() on
its config_kde module, which actually causes libkdecore to be loaded and
initialized.

In particular, with German locale, snprintf() would use "," instead of
"." when formatting float values, which in combination with playback
resume, would lead to parse errors the next time mpv was started, which
is how this issue was found.

I'd consider this a bug with libkdecore or at least libproxy. No library
should ever even touch locale: it might break basic expectations on C
string handling functions, might override program settings, and it's not
thread-safe. But this is so nasty and severe, that a quick hack to fix
it hurts less.

See github issue #279 and KDE bug #325902.
2013-10-12 18:56:03 +02:00
Stefano Pigozzi 57c3fca7a8 cocoa: refactor precise scrolling to a separate method 2013-10-12 16:26:53 +02:00
Mad Fish 42189ada97 cocoa: fix mouse wheel scrolling 2013-10-12 16:26:24 +02:00
Mohammad Alsaleh 65a3977282 mpvcore/playlist.c: Avoid NULL reference in playlist_add_base_path()
Before this patch, those will cause a crash:

  mpv -playlist /dev/null
  mpv -playlist <(bla) # if the result of bla is empty

Signed-off-by: Mohammad Alsaleh <CE.Mohammad.AlSaleh@gmail.com>
Signed-off-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
2013-10-11 18:01:47 +02:00
Stefano Pigozzi 177c89d948 cocoa_common: check if the screen has a menubar in a more generic way
Fixes #274
2013-10-09 09:27:41 +02:00
Ben Boeckel 67eb187826 matroska: use memmove when collapsing the source list down 2013-10-08 22:00:23 -04:00
Ben Boeckel 47345219a3 matroska: avoid requesting the same source multiple times 2013-10-08 22:00:23 -04:00
William Light 16450fab3f mp_ring: fix mp_ring_read_cb() when read wraps around
previously, mp_ring_read_cb() would allow reading past the end of the
ringbuffer when buffered > available. mp_ring_read() had logic for
splitting the read into two, which I duplicated into mp_ring_read_cb().
2013-10-08 20:03:57 +02:00
Ben Boeckel f72a900892 matroska: support chapter references to ordered editions
Since ordered editions can reference external files, when an ordered
chapter references another ordered edition, we have to go and figure out
what is is referencing as well.
2013-10-08 00:51:50 -04:00
Ben Boeckel 5cd33853f2 matroska: recursively search for referenced segments
When playing a Matroska file with ordered chapters, it may reference
another file by edition uid. When this edition is also ordered, it may
reference other files. When this occurs, the new segment/edition pair is
added to the list of sources to search for.
2013-10-08 00:51:50 -04:00
Ben Boeckel d8e5ac00bb matroska: refactor ordered chapter timeline building
This will need to be recursive to support chapters referencing ordered
editions in other files.
2013-10-07 22:43:42 -04:00
Ben Boeckel 2fe2be4df3 matroska: select the edition using the requested edition uid 2013-10-07 22:42:40 -04:00
Ben Boeckel 069a2d047d matroska: set the edition uid when reading a chapter reference 2013-10-07 22:40:40 -04:00
Ben Boeckel 4f287f1792 matroska: parse the requested edition for the segment reference 2013-10-07 22:40:40 -04:00
Ben Boeckel 07fbba3935 matroska: store segment/edition uids in a single structure
To support edition references in matroska chapters, editions need to be
remembered for each chapter and source. To facilitate easier management
of these now-paired uids, a single structure is used.
2013-10-07 22:40:39 -04:00
wm4 5c3abb9082 demux_raw: set a default video size 2013-10-07 17:21:53 +02:00
wm4 de6eace6e9 command: sub_seek: avoid getting stuck
First, don't try to seek if the result is 0 (i.e. nothing found, or
subtitle event happens to be exactly on spot).

Second, since we never can make sure that we actually seek to the exact
subtitle PTS (seeking "snaps" to video PTS), offset the seek by 10ms.
Since most subtitle events are longer than 10ms, this should work fine.
2013-10-07 17:21:53 +02:00
ChrisK2 ccdaecfc5c osc: Okay, don't multiply the cache value
As expected, this is not liked.
2013-10-07 00:56:11 +02:00
ChrisK2 f3556356b7 osc: Display cache fill status
The OSC will now display cache fill status between the timecodes, but only if it's below 48% to not clutter the interface with erratically changing values.

By default, the displayed value is multiplied by 2 to not confuse users who are unfamillar with the inner workings of the caching system. This can be disabled using the iAmAProgrammer=true setting.
2013-10-07 00:04:35 +02:00
ChrisK2 99adbe1e7c osc: Add another scale option for forced windows.
If the OSC is rendered on a forced window (by --force-window), the scale can be configured with scaleForcedWindow.
2013-10-06 23:44:46 +02:00
Thomas Orgis 55883943c5 ad_mpeg123: support in-stream format changes
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36461 b3059339-0415-0410-9bf9-f77b7e298cf2

Fixes playback of http://mpg123.org/test/44and22.mp3

Cherry-picked from MPlayer SVN rev. #36461, a patch by
Thomas Orgis, committed by by Reimar Döffinger.
2013-10-06 23:41:18 +02:00
wm4 8304046180 vo_x11, vo_xv: fix OSD redrawing with --force-window
The window wasn't cleared in this mode before doing the redrawing.
2013-10-06 23:03:30 +02:00
wm4 2d638347c1 mplayer: don't resume playlist if --no-resume-playback is used 2013-10-06 21:54:00 +02:00
Christian Neukirchen 2119bcbeac ao_sndio: add documentation 2013-10-05 22:47:20 +02:00
wm4 ae9a3e33aa command: add commands for displaying overlays
Requested by github issue #255.

Does not work where mmap is not available (i.e. Windows).
2013-10-05 22:46:55 +02:00
wm4 fd49edccf8 command: add properties for retrieving OSD dimensions 2013-10-05 22:46:55 +02:00
wm4 1be863afdb mplayer: fix some issues with playlist_prev command
You couldn't jump to the first entry in the playlist, if that entry was
marked as "too short". But this is usually fine, because it doesn't get
into the way of the user. (This feature is meant to allow being able to
jump backwards through the playlist even if a file immediately stops
playback right after initialization, not to prevent playing these files
at all.)

Also, apply the skip logic when wrapping around the playlist when going
backwards. This happens with --loop, because looping pretends the
playlist is infinitely repeated forwards and backwards (as long as the
playlist_prev/next commands are concerned).

Also add some comments.
2013-10-05 22:46:55 +02:00