Commit Graph

36938 Commits

Author SHA1 Message Date
ChrisK2 218b9d3737 osxbundle: use mpv's version.sh instead of osxbundle's 2013-12-09 21:45:09 +01:00
wm4 398bfbe4c1 compat: add compatibility kludge for Libav 9
Libav 9 still uses the unprefixed PIX_FMT_... symbols, but they will
probably be removed some time in the future.

There are some other deprecations we have yet to take care of, but
there are no clear replacements yet.
2013-12-08 23:51:39 +01:00
Diogo Franco (Kovensky) 04faf9a1cb ao_wasapi: Fix mistaken behavior on uninit
The parameter, when true, tells whether uninit should block for flushing
the buffers, not whether it should quit immediately without flushing.
2013-12-08 19:36:44 -03:00
Diogo Franco (Kovensky) c7064ce5e5 ao_wasapi: handle AOPLAY_FINAL_CHUNK
Used for writing down all samples to the audio driver, even if it's not
a full chunk; needed at EOF on weird files.
2013-12-08 19:36:43 -03:00
Diogo Franco (Kovensky) 8f4380d6d5 ao_wasapi: Reduce the buffer size to a sane value
The previous RING_BUFFER_COUNT value, 64, would have ao_wasapi buffer 64
frames of audio in the ring buffer; a delay of 1280ms, which is clearly
overkill for everything. A value of 8 buffers 8 frames for a total of
160ms.
2013-12-08 19:14:56 -03:00
Diogo Franco (Kovensky) 2329e46229 ao_wasapi: fix audio buffering delay calculation
When get_space was converted to returning samples instead of bytes, a
unit type mismatch in get_delay's calculation returned bogus values. Fix
by converting get_space's value back to bytes.

Fixes playback with ao_wasapi when reaching EOF, or seeking past it.
2013-12-08 19:03:26 -03:00
wm4 62925a5c15 options: allow hwaccel formats in -vf format/noformat
There are 3 users of the image format option type: demux_raw,
vf_format, vf_noformat. Allow the hwaccel formats (like vdpau etc.)
in general, so that the filters can use it. This won't work for
demux_raw, so explicitly reject these formats there.
2013-12-07 19:39:45 +01:00
wm4 d658b115a0 vf: redo conversion filter insertion/format negotiation
Remove the inconsistent, duplicated, and insufficient scale filter
insertion code, and do it in one place instead. This also compensates
for the earlier removal of vf_match_csp() (which was in fact duplicated
code).

The algorithm to determine where to insert a filter etc. is probably the
same, though it also comes with some changes that should make debugging
easier when trying to figure out why a chain is failing to configure.

Add an "in" pseudo filter, which makes insertion of conversion filters
easier. Also change the vf->reconfig signature. At a later point, I'll
probably change format negotiation such that the generic filter code
will choose the output format, so having separate in and out params will
be useful.
2013-12-07 19:35:55 +01:00
wm4 37fbef2ccb video/filter: make vf->control non-recursive
Reason: I never liked it being recursive. Generally, this seems to
cause more problems than trouble, and is less flexible for access
outside of the chain.
2013-12-07 19:33:38 +01:00
wm4 0af9ede546 vf: remove flags from filter format status
I don't think we need these flags anymore. Simplify the code and get rid
of the vf_format struct.

There still is the vf_format.configured field, but this can be replaced
by checking for a valid image format.
2013-12-07 19:33:11 +01:00
wm4 bb6165342d video: create a separate context for video filter chain
This adds vf_chain, which unlike vf_instance refers to the filter chain
as a whole. This makes the filter API less awkward, and will allow
handling format negotiation better.
2013-12-07 19:32:44 +01:00
wm4 75d3bf4711 video/filter: remove vf_match_csp()
This function improves automatic filter insertion, but this really
should be done by the generic filter code. Remove vf_match_csp() and all
code using it as preparation for that.

This commit temporarily makes handling of filter insertion worse for
now, but it will be fixed with the following commits.
2013-12-07 19:32:03 +01:00
wm4 6025abffda vf: remove unused function 2013-12-07 19:31:47 +01:00
wm4 a54b775f80 vf: print error when creating filter fails
Before that we relied on the filters printing their own error messages.
2013-12-07 19:31:33 +01:00
wm4 745b9d542b manpage: remove some --flip leftovers 2013-12-07 19:30:46 +01:00
wm4 070269df73 mixer: remove comment about af_pan doing downmixing
We don't do that anymore.
2013-12-07 19:30:14 +01:00
wm4 e8a5aaf883 manpage: mark "run" command as Unix-only 2013-12-07 19:29:56 +01:00
wm4 5b19a66cff command: fix compilation with MinGW
This include header is needed for the fork/exec code, which is inactive
on Windows anyway.
2013-12-07 19:29:52 +01:00
Stefano Pigozzi e4f35516fb stream: fix clang warning
Good clang catches programming errors. `open(2)` takes `int` not `mode_t`.
2013-12-07 17:14:20 +01:00
bugmen0t 20d1fc132e build: prefer 4Front OSS to native implementations
If sys/soundcard.h is actually linux/soundcard.h then it supports only OSSv3
API. This may happen when OSSLIBDIR == /usr while forgetting to replace
sys/soundcard.h from glibc.

However, after fa620ff waf prefers native implementation which is inferior
on Linux. To fix try making waf prefer oss-audio-4front. It's quite unusual
to have 4Front OSS installed where native implementation is superior, anyway.
Signed-off-by: bugmen0t <@>

Make the false positives path also undef the 4Front define.
Signed-off-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>

Fixes #396
2013-12-07 17:04:34 +01:00
agiz a066dae19e cocoa: make borderless window resizable
Fixes #399
2013-12-07 15:43:49 +01:00
Stefano Pigozzi b454cc0ca3 macosx_events: fix null dereference on uninit
Bug introduced by commit 6fb020f5. It doesn't always happen, since it is
caused by the playloop and cocoa UI code running in separate threads.

Fixes #398.
2013-12-07 15:29:53 +01:00
wm4 8f3d0b5e53 player: load external subs for uncompressed rar archives
Uncompressed rar archives can be transparently opened, but the filename
the player doesn't have the direct filename (but something starting
with rar://... instead). This will lead to external subtitles not
being loaded.

This doesn't handle multi-volume rar files, but in that cases just use
the --autosub-match=fuzzy option.

Fixes #397 on github.
2013-12-06 23:00:19 +01:00
Stefano Pigozzi a53abbf4a6 build: fix regression in cross-compilation [2]
Fixup commit for 5cb8439015. getattr only works on dot notation.
2013-12-06 10:32:21 +01:00
agiz 4ed4341df8 build: fix linking to CoreFoundation
If only coreaudio was activativated and not cocoa, the build failed for
missing CoreFoundation.

Signed-off-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
Fixes #395
2013-12-06 10:25:54 +01:00
Stefano Pigozzi f89bd7c5c2 build: link ARC to get subscripting implementation
This is needed on OS X 10.7 to handle Objective-C subscripting correctly. It
was present in the old configure, but I forgot it in the wscript.
2013-12-06 00:14:01 +01:00
wm4 9839bb08df vf: declare config() as legacy 2013-12-05 22:58:54 +01:00
wm4 2d0a9c7af0 video/filter: remove unneeded config callbacks
They didn't do anything.

vf_screenshot.c actually did release the previous image, but that's not
really required. At worst you could take a screenshot and get an old
frame when there's no new frame yet.
2013-12-05 22:58:54 +01:00
wm4 66e20ef8ad video: remove --flip
The --flip option flipped the image upside-down, by trying to use VO
support, or if not available, by inserting a video filter. I'm not sure
why it existed. Maybe it was important in ancient times when VfW based
decoders output an image this way (but even then, flipping an image is a
free operation by negating the stride).

One nice thing about this is that it provided a possible path for
implementing video orientation, which is a feature we should probably
support eventually. The important part is that it would be for free for
VOs that support it, and would work even with hardware decoding.

But for now get rid of it. It's useless, trivial, stands in the way, and
supporting video orientation would require solving other problems first.
2013-12-05 22:58:54 +01:00
wm4 b2c4653b88 vf: move norm_qscale() to the only filter which uses it 2013-12-05 22:58:53 +01:00
wm4 e3809e5b52 vf_sub, vf_dlopen: default struct is not needed 2013-12-05 22:58:53 +01:00
wm4 4904df42e9 vf: cleanup removed filter entry 2013-12-05 22:58:53 +01:00
wm4 e1966e4aae video: allow hardware decoding only for certain codecs
In particular, this disables mpeg4. There are some files out there that
use GMC, a usually rarely used and ineffective feature, which is not
supported by most hardware decoders. In these cases the hw decoder
outputs garbage, while software decoding works perfectly fine. We can't
really fallback to software decoding in these cases, because we don't
know that something is wrong in the first place. I can't see any
advantages of hw decoding of mpeg4, so it's better to disable it.
2013-12-05 22:58:53 +01:00
wm4 a558d84108 docs: edl: minor corrections 2013-12-05 22:58:53 +01:00
Stefano Pigozzi 5cb8439015 build: fix regression in cross-compilation
Regression was introduced in bf90317ad in an attempt to fix the Lua check.
2013-12-05 21:38:16 +01:00
wm4 f6e68b33bc video/filter: fix some bogus free() calls
The generic filter code frees these; recent regression.
2013-12-05 01:50:05 +01:00
wm4 84cfe0d8b2 audio: flush remaining data from the filter chain on EOF
This can be reproduced with:

   mpv short.wav -af 'lavfi="aecho=0.8:0.9:5000|6800:0.3|0.25"'

An audio file that is just 1-2 seconds long should play for 8-9 seconds,
which audible echo towards the end.

The code assumes that when playing with AF_FILTER_FLAG_EOF, the filter
will either produce output, or has all remaining data flushed. I'm not
really sure whether this really works if there are multiple filters with
EOF handling in the chain. To handle it correctly, af_lavfi should retry
filtering if 1. EOF flag is set, 2. there were input samples, and 3. no
output samples were produced. But currently it seems to work well enough
anyway.
2013-12-05 00:31:55 +01:00
wm4 ed024aadb6 audio/filter: change filter callback signature
The new signature is actually closer to how it actually works, and
someone who is not familiar to the API and how it works might make fewer
fatal mistakes with the new signature than the old one. Pretty weird.

Do this to sneak in a flags parameter, which will later be used to flush
remaining data of at least vf_lavfi.
2013-12-05 00:01:46 +01:00
wm4 2bcfb49a39 ad_lavc: handle decoder EAGAIN only if there was an input packet
Otherwise, it'd probably get stuck if the decoder still returns EAGAIN
at EOF on e.g. a shortened data stream.
2013-12-04 23:30:01 +01:00
wm4 e9f49ea84d options: remove legacy hacks for sub-option handling 2013-12-04 23:13:46 +01:00
wm4 193930ac3b af: remove af->setup field
Used to be used by filters that didn't use the option parser.
2013-12-04 23:13:46 +01:00
wm4 09bd19e59e af: remove legacy option parsing hacks 2013-12-04 23:13:46 +01:00
wm4 82983970b3 af_pan: change options, use option parser
Similar to af_channels etc...
2013-12-04 23:13:46 +01:00
wm4 adc843f984 af_ladspa: change options, use option parser 2013-12-04 23:13:46 +01:00
wm4 bcd8afc2ad af_delay: change option parsing, fix bugs, use option parser
Similar situation to af_channels.
2013-12-04 23:13:46 +01:00
wm4 71b6115d66 af_channels: use "unknown" channel layouts
This will make af_channels output a channel layout that is compatible
with any destination layout. Not sure if that's a good idea though,
since the way the AO choses a layout is perhaps less predictable. On the
other hand, using the old MPlayer standard layouts doesn't make much
sense either. We'll see whether this improves or breaks someone's use
case.
2013-12-04 23:13:46 +01:00
wm4 4f581a781b af_channels: change options, fix bugs, use option parser
Apparently this stopped working after some planar changes (broken format
negotiation). Radically change option parsing in an incompatible way.
Suggest alternatives to this filter, since it barely has any importance
anymore.
2013-12-04 23:13:42 +01:00
wm4 ad8e3d8c30 af_sweep: use option parser 2013-12-04 23:12:52 +01:00
wm4 d74419e6f0 af_surround: use option parser 2013-12-04 23:12:52 +01:00
wm4 54b8a7150a af_sub: use option parser 2013-12-04 23:12:52 +01:00