Commit Graph

35062 Commits

Author SHA1 Message Date
elevengu b2c2fe7a37 core: support mpv directory itself as a valid location for config files on Windows
This prefers ./ on Windows if-and-only-if the file being searched for
already exists there. (If the mpv directory is non-writable, the result
is still intended behavior.) This change is transparent to most users
because the user has to move the config files there intentionally, and
if anything, not being detected would be the surprising behavior.
2013-05-23 01:01:41 +02:00
wm4 3cae1b9fc9 vo: remove unused callback 2013-05-23 00:54:46 +02:00
wm4 0e071892c3 mplayer: don't cut status line if --no-consolecontrols is used 2013-05-21 22:07:24 +02:00
wm4 64a78cf314 demux_lavf: workaround minor ffmpeg memory leak
The sequence of avcodec_alloc_context3() / avcodec_copy_context() /
avcodec_close() / av_free() leaks some memory. So don't copy the context
and use it directly.

Originally avcodec_copy_context() was used to guarantee that libavformat
can't update the fields of the context during demuxing in order to make
things a little more robust, but it's not strictly needed, and
ffmpeg/ffplay don't do this anyway. Still might make the situation worse
should we move demuxing into a separate thread, though.
2013-05-21 22:07:13 +02:00
wm4 b477c68aa0 demux: workaround for -demuxer mpegts -correct-pts
Using -demuxer mpegts -correct-pts triggered the assertion in
ds_get_packet2(). This is not surprising, because the correct-pts code
was changed to accept _complete_ packets, while all the old demuxers
(including the mpegts demuxer) require you to use "partial" packet
reads, together with the video_read_frame(). (That function actually
parses video frames, so fragments of the original "packets" can be fed
to the decoder.)

However, it returns out demux_ts packet's are mostly useable. demux_ts
still adds an offset (i.e. ds->buffer_pos != 0) to the packets when
calling internal parser functions, such as in parse_es.c. While this is
unclean design due to mplayer's old video demuxing/decoding path, it can
be easily be made work by modifying the packet as returned by
ds_get_packet2(). We also have to change the packet freeing code, as
demux_packet->buffer doesn't have to point to the start of the memory
allocation anymore.

MPlayer handles this "correctly" because it doesn't have a function that
reads a complete packet.
2013-05-21 22:07:13 +02:00
wm4 e8be121580 demux_mkv: support dirac in mkv
Nobody uses this, and this is an absolute waste of time. Even the user
who reported this turned out to have produced a sample manually.

Sample produced with:

wget http://diracvideo.org/download/test-streams/raw/vts/vts.LD-8Mb.drc
mkvmerge -o dirac.mkv vts.LD-8Mb.drc

mkvmerge writes a sort of broken aspect ratio. libavformat interprets it
as 1:1 PAR, while demux_mkv thinks this is a 1:1 DAR. Maybe libavformat
is more correct here.
2013-05-21 22:07:12 +02:00
wm4 b718f328d4 options: remove dead -dr1 option 2013-05-21 00:46:53 +02:00
wm4 1dff26730a dec_video: get rid of two global variables 2013-05-21 00:45:42 +02:00
wm4 644131fdb4 dec_video: remove emms usage
libavcodec generally shouldn't have this problem anymore (if libavcodec
ever had it). All other video decoders are gone. In any case, if this
commit actually causes regressions, these are libavcodec bugs and should
be fixed there instead.
2013-05-21 00:40:37 +02:00
wm4 9ccb1739b2 mplayer: re-add some legacy slave mode output for issue #92
In the long run this should be done differently. ID_... output sucks.
This commit will be reverted as soon as I have a good idea how this
should be done properly.
2013-05-21 00:32:38 +02:00
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