Commit Graph

35252 Commits

Author SHA1 Message Date
Stephen Hutchinson 08bfe8721c configure: map --enable-sdl2 to autodetection
Commit 02bbd87b disabled SDL linking by default. This commit followed
the ancient mplayer convention of disabling detection of compiler flags
with  --enable-* switches. Unfortunately, this makes compiling with SDL
enabled a pain.

Make --enable-sdl/sdl2 use autodetection, even if it's inconsistent with
most other --enable-* switches. The same is already done for
--enable-openal, though.

Based on a pull request by qyot27.
2013-05-21 00:14:42 +02:00
wm4 4dc8c0756f vf_lavfi: remove redundant statements 2013-05-21 00:12:20 +02:00
wm4 1ced961b92 m_option: fix parameter comparison for vf-toggle
The vf-toggle option parsing (normally used for runtime video filter
switching only) was missing comparing the parameter values. Fix this,
and also make the code a bit more robust.
2013-05-21 00:12:13 +02:00
wm4 d356f3efd2 m_option: fix -vf-del in profiles
We don't bother with option verification (as it happens in profiles),
because it's barely possible.
2013-05-21 00:04:46 +02:00
wm4 266230ad64 Silence some compiler warnings
None of these were actual issues.
2013-05-21 00:04:27 +02:00
Stefano Pigozzi 3b54dce9e5 travis: fix typo
[ci skip]
2013-05-20 18:12:39 +02:00
Stefano Pigozzi 89fc8326b9 travis: DRY up the yaml file
Use YAML's anchor/reference syntax to DRY up the YAML file. Also fix a bug
that caused the IRC notification to always take place (even on success).
2013-05-20 09:09:02 +02:00
Rudolf Polzer 5589412b3c vf_dlopen framestep: step width of 0
This is now defined to mean to never output any frame again (except for
the first).
2013-05-20 06:59:44 +02:00
Rudolf Polzer 34e542591b vf_dlopen framestep filter: add a parameter for the phase
also, default to 0-indexed frame counts (so by default, the 1st frame is
output). Old behaviour can be done by -vf dlopen=./framestep.so:42:41.
2013-05-20 06:55:29 +02:00
Stefano Pigozzi d8c06cd99e add Travis-CI integration
Travis-CI [1] is a continous integration cloud service. It is free for
open-source projects and tigthly integrated tiwh GitHub so there is really
no reason for us not use it. :)

For now we are going to do a total of 4 builds, mainly to test ffmpeg/libav
API breakage:

 * ffmpeg-stable, libass-stable
 * ffmpeg-git, libass-stable
 * libav-stable, libass-stable
 * libav-git, libass-stable

The compiler that is currently used is clang for two reasons:

 * running 8 build targets would be quite wasteful and take a long time
 * clang is less tested and used during development than gcc (especially on
   linux)

Currently Travis doesn't support OS X environments alongside Linux ones [2].
When it will, we will add a fifth build target to test OS X compilation
breakage.

README was moved to markdown to add the little build status image. I ran some
tests with my GitHub fork and couldn't get images to show up using ReStructured
Text.

 [1]: https://github.com/travis-ci/travis-ci
 [2]: travis-ci/travis-ci#216
2013-05-19 20:41:40 +02:00
wm4 b5f07e86b8 configure: reject older libswresample
mpv still builds with ffmpeg 1.0.x, however libswresample keeps cuasing
trouble. In older releases, libswresample simply crashed when
downmixing. In somewhat newer versions, it produces distorted output and
downmixing isn't even close to correct.

With ffmpeg release 1.1 (ffmpeg git tag n1.1), everything seems to work
fine. The release uses 0.17.102 as libswresample version, so bump the
required minimum version to that.
2013-05-19 14:06:59 +02:00
wm4 ad8aae1708 Fix commit d1b37af
Yeah, it doesn't work this way... Please look away.
2013-05-18 17:52:17 +02:00
wm4 228c3d209c vo_image: start image file numbers at 1
Requested by a user.
2013-05-18 17:45:55 +02:00
wm4 541fe30ba9 input: allow quotes around any input command 2013-05-18 17:45:55 +02:00
wm4 58cc0f637f input: do property expansion for all input command string arguments
Also add a "raw" prefix for commands, which prevents property expansion.
The idea is that if the commands are generated by a program, it doesn't
have to know whether the command expands properties or not.
2013-05-18 17:45:55 +02:00
wm4 3e6ec6dfa5 input: accept input command prefixes in any order
This is more consistent, and doesn't bother the user with ordering
rules when new prefixes are added.

Will break obscure uses of legacy commands: if the command is supposed
to be translated by the legacy command bridge, and if that command uses
one of the pausing* prefixes, the command can't be parsed. Well, just
use the new commands in this case.
2013-05-18 17:45:55 +02:00
wm4 b0a60b7321 video/filter: fix option parser memory leak
This happens only if an option actually allocates memory (like strings).

Change filter API such that vf->priv is free'd by vf.c instead by the
filters. vf.c will free the option values as well.
2013-05-18 17:45:55 +02:00
wm4 f569d245ba core: allow changing filter filters at runtime
Add the "vf" command, which allows changing the video filter chain at
runtime. For example, the 'y' key could be bound to toggle deinterlacing
by adding 'y vf toggle yadif' to the input.conf.

Reconfiguring the video filter chain normally resets the VO, so that it
will be "stuck" until a new video frame is rendered. To mitigate this, a
seek to the current position is issued when the filter chain is changed.
This is done only if playback is paused, because normal playback will
show an actual new frame quickly enough.

If vdpau hardware decoding is used, filter insertion (whether it fails
or not) will break the video for a while. This is because vo_vdpau
resets decoding related things on vo_config().
2013-05-18 17:45:54 +02:00
wm4 d1b37aff32 m_option: allow -vf ""
With the current semantics, there's no reason to disallow this.

(Although in my opinion, -vf should rather map to -vf-add than -vf-set,
however that is an independent issue from this change.)
2013-05-18 17:45:54 +02:00
wm4 6b42881791 m_option: add -vf-toggle
Works like -vf-add, except if a filter already exists and has the same
parameters, it's removed instead of added.

Not really useful on the command line itself, but will make sense for
runtime filter changing in the following commit.
2013-05-18 17:32:37 +02:00
wm4 1dad548640 m_option: allow using -vf-del with a name
Until now, -vf-del required a list of indexes. This was a bit
inconvenient, so add support for using filter names too. Also simplify
the code a bit, doing the change would have been too painful otherwise.
2013-05-18 17:32:37 +02:00
wm4 41d38b3a2b vd_lavc: change VDCTRL_REINIT_VO behavior
This tried to use ctx->pic (last decoded AVFrame) for the frame bounds.
However, if av_frame_unref() on the AVFrame is called, the function will
reset _all_ AVFrame fields, even those which are not involved with
memory management. As result, mpcodecs_config_vo() was called with 0
width/height, which made the function exit early, instead of
reconfiguring the filter chain.

Go back to using mpcodecs_config_vo() directly. (That's what it did
before this VDCTRL was originally introduced; the original reason for
it disappeared.)
2013-05-18 17:32:37 +02:00
wm4 c970f5c328 video: rename VDCTRL_RESET_ASPECT to VDCTRL_REINIT_VO
Same thing, and VDCTRL_REINIT_VO implies more generic use.
2013-05-18 17:32:37 +02:00
wm4 f921a675ae manpage: document af_* commands
Except af_cmdline, which is too questionable.
2013-05-18 17:32:37 +02:00
wm4 e40ae27a87 mp_image: align image allocation height
vo_vdpau actually reads past the image allocation when displaying a
non-mod 2 420p image. The vdpau API specifies that VdpVideoSurfacePutBitsYCbCr()
requires a height that is a multiple of 4, and surface allocations are
automatically rounded.

So allocate video images with rounded height. libavutil does the same,
so images coming directly from the decoder or from libavfilter are no
problem. (libavutil does this alginment explicitly, not just because the
decoded image size is aligned to macroblocks.)
2013-05-17 23:45:55 +02:00
wm4 883d03fffd cfg-mplayer: fix some option flags 2013-05-17 00:16:27 +02:00
Stefano Pigozzi f9ed43077f cocoa_common: vo_corevideo: fix window initialization
vo_corevideo doesn't create a hidden window to perform OpenGL extensions
detection. This caused the window to always stay close.
2013-05-16 23:46:31 +02:00
Rudolf Polzer 2958ae39ca vf_dlopen examples: slightly simply the framestep filter
We don't need config() ;)
2013-05-16 20:21:54 +02:00
Rudolf Polzer cfa0515e0e vf_dlopen examples: add framestep filter
Usage: -vf dlopen=./framestep.so:5
2013-05-16 20:14:50 +02:00
wm4 d4987bf5eb options: fix exit code when using help options
Basically a cosmetic change. Fixes github issue #88.
2013-05-15 16:02:52 +02:00
wm4 a32cc6fcb2 mplayer: potentially fix main() return value
The main() function is special, and omitting the return statement would
make it always return 0. And also, mpv_main() actually never returns, it
calls exit() through exit_player() instead. But change it anyway,
because it looks misleading.
2013-05-15 15:48:40 +02:00
wm4 db69e0edd4 options: add -V as alias for --version
This is a common convention.
2013-05-15 15:34:11 +02:00
wm4 759b3bdc47 options: use case-sensitive comparsion for options
This is better for consistency, and also allows using -V as alias
for --version.
2013-05-15 15:30:06 +02:00
wm4 894288457b options: add --version 2013-05-15 15:14:24 +02:00
wm4 4930681e7a command: use "title" tag for media-title property if available
In connection with the previous commit, this will use the Matroska title
for the media-title property.
2013-05-15 15:06:21 +02:00
wm4 c2f96b020d demux_mkv: export Matroska title element as metadata 2013-05-15 15:00:52 +02:00
Paul B Mahol 83570fc0fb add osd-scale command
Signed-off-by: Paul B Mahol <onemda@gmail.com>

Modified to add docs for --osd-scale option, and adjusted to the
previous commit by wm4.
2013-05-14 23:32:07 +02:00
wm4 f562a41ca2 command: simplify sub OSD update
We can just update all OSD elements in these cases. This way we can also
reuse it for commands which need to update the OSD for other reasons.
2013-05-14 23:14:23 +02:00
Rudolf Polzer 3edb563b23 m_option: fix segfault in parse_chmap 2013-05-14 14:45:06 +02:00
wm4 bc8815d69f vd_lavc: hack-fix vdpau decoding with non mod 16 video
This changes the code so that it does the same as MPlayer, mplayer2
and mpv before ref-counted AVFrame. The problem is that get_buffer2
is called with aligned frame dimensions, while get_buffer didn't. This
breaks the mpv video frame size change detection.
2013-05-14 01:10:05 +02:00
Stefano Pigozzi 647291bab2 cocoa_common: order front window only when invisible [2]
Followup to 8df7127. This refines the condition for front ordering the
condition to account for minimized or hidden state where the window should go
to the front only as a consequnce of user interaction.
2013-05-14 00:16:57 +02:00
wm4 4931085a1b chmap: fix oddity due to ambiguous 6.1 ffmpeg channel layout
FFmpeg (as well as Libav) have two layouts called "6.1":
AV_CH_LAYOUT_6POINT1 and AV_CH_LAYOUT_6POINT1_BACK. We call them "6.1"
and "6.1(back)". Change the default layout for 7 channels as well to
return the same layout as av_get_default_channel_layout(). (Looks a bit
questionable, but for now it's better to follow FFmpeg.)
2013-05-13 23:55:39 +02:00
Stefano Pigozzi 8df712781c cocoa_common: order front window only when invisible
Window creation code always made mpv the front window. Fix it to make it front
only if the window is currently invisible.

Fixes #84
2013-05-13 23:49:00 +02:00
Stefano Pigozzi d2960d2e96 cocoa_common: don't use recursive locking
This was in the original change set for the threadsafety changes but I forgot
to squash it in.
2013-05-13 23:41:03 +02:00
Stefano Pigozzi 4878be02ad cocoa_common: remove pointless locking when using -fs
When using --fs `vo_cocoa_fullscreen` was called from the primary thread. This
occurred inside `vo_cocoa_config_window` which is scheduled for excution on the
primary thread with libdispatch).

All of this caused spam from NSRecursiveLock in standard output.
2013-05-13 23:41:03 +02:00
Stefano Pigozzi 4ce808cc2c cocoa_common: fix a bug in window dragging state
When going in and going out of full screen the player lost information on the
movableByWindowBackground behaviour. There were some hacks in place to fix it
but they were broken with the recent native fullscreen changes in 74c15ec6.

This commit removes the problem at the root and removes the hacks. The delegate
method `isMovableByWindowBackground` seems to be called after setFrame and
setPresentationOptions so change fs state in opts before that.

Fixes #83
2013-05-13 23:41:03 +02:00
wm4 a39d369c25 audio: fix ALSA 4 channel surround output
It turns out that ALSA's 4 channel layout is different from mpv's and
ffmpeg's 4.0 layout. Thus trying to do 4 channel output led to incorrect
remixing via lib{av,sw}resample.

Fix the default layouts for the internal filter chain as well, although
I'm not sure if it matters at all.
2013-05-13 18:27:09 +02:00
wm4 636e1edd9e af_lavrresample: fix inverted condition
This was added with the previous commit. It likely broke some obscure
special-cases, which (hopefully) do not happen with normal playback.
2013-05-13 18:05:37 +02:00
wm4 279f4b59dc audio: fix compilation with older libavresample versions
The libavresample version of the current Libav stable release lacks the
avresample_set_channel_mapping() function. (FFmpeg's libswresample seems
to be fine, because they added swr_set_channel_mapping() first.)

Add a cheap/slow workaround to do channel reordering on our own. We
don't use the recently removed MPlayer code (see commit 586b75a),
because that is not generic enough.

The functionality should be the same as with full-featured
libavresample, and any differences are bugs. It's probably slower,
though.
2013-05-13 00:39:07 +02:00
Stefano Pigozzi 35c8f7b608 cocoa_common: fix deadlock when calling resize_redraw
Fixes #82
2013-05-12 23:51:58 +02:00