Commit Graph

36773 Commits

Author SHA1 Message Date
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
wm4 ee7ff874ba af_sinesuppress: use option parser 2013-12-04 23:12:52 +01:00
wm4 98905f668f af_hrtf: use option parser 2013-12-04 23:12:52 +01:00
wm4 aaccf9d5e9 af_extrastereo: use option parser 2013-12-04 23:12:51 +01:00
wm4 2c23fae344 af_export: use option parser
Probably requires the user to quote the shared buffer filename.
2013-12-04 23:12:51 +01:00
wm4 5b7eb713a1 af_equalizer: use option parser 2013-12-04 23:12:51 +01:00
wm4 349376aa5c af_drc: use option parser 2013-12-04 23:12:51 +01:00
wm4 0205f3d214 af_center: use option parser 2013-12-04 23:12:51 +01:00
wm4 a27114bb4b af: returning NULL on filtering means error
This code used to be ok, until the assert() was added. Simplify the loop
statement, since the other NULL check for data doesn't make sense
anymore.
2013-12-04 23:12:51 +01:00
wm4 59aed93208 ad_lavc: expose an option to enable threading 2013-12-04 23:12:51 +01:00
wm4 47c4b5c000 vd_lavc: factor out libavcodec thread setup 2013-12-04 23:12:51 +01:00
wm4 0afd121ae6 vd_lavc: don't check required hwdec fields 2013-12-04 23:12:51 +01:00
wm4 9c2858f37f ad_lavc: deal with arbitrary decoder delay
Normally, audio decoder don't have a decoder delay, so the code was
fine. But FFmpeg supports multithreaded decoding for some audio codecs,
which introduces such a delay.

The delay means that we won't get decoded audio for the first few
packets, and that we need to do something to get the trailing audio
still buffered in the decoder when reaching EOF.

Two changes are needed to deal with the delay:
- If EOF is reached, pass a "flush" packet to the decoder to return the
  buffered audio. Such a flush packet is automatically setup when
  calling mp_set_av_packet() with a NULL packet.
- Use the PTS returned by the decoder, instead of the packet's. This is
  important to get correct timestamps for decoded audio. Ignoring this
  would result into offsetting the audio playback time by the decoder
  delay. Note that we can still use the timestamp of the first packet
  to get the timestamp for the start of the audio.
2013-12-04 23:12:51 +01:00
wm4 8a84da8102 av_common: add timebase parameter to mp_set_av_packet()
If the timebase is set, it's used for converting the packet timestamps.
Otherwise, the previous method of reinterpret-casting the mpv style
double timestamps to libavcodec style int64_t timestamps is used.

Also replace the kind of awkward mp_get_av_frame_pkt_ts() function by
mp_pts_from_av(), which simply converts timestamps in a way the old
function did. (Plus it takes a timebase parameter, similar to the
addition to mp_set_av_packet().)

Note that this should not change anything yet. The code in ad_lavc.c and
vd_lavc.c passes NULL for the timebase parameters. We could set
AVCodecContext.pkt_timebase and use that if we want to give libavcodec
"proper" timestamps.

This could be important for ad_lavc.c: some codecs (opus, probably mp3
and aac too) have weird requirements about doing decoding preroll on the
container level, and thus require adjusting the audio start timestamps
in some cases. libavcodec doesn't tell us how much was skipped, so we
either get shifted timestamps (by the length of the skipped data), or we
give it proper timestamps. (Note: libavcodec interprets or changes
timestamps only if pkt_timebase is set, which by default it is not.)
This would require selecting a timebase though, so I feel uncomfortable
with the idea. At least this change paves the way, and will allow some
testing.
2013-12-04 23:12:51 +01:00
wm4 e2dfdc0c7e manpage: use different quoting in example
Using "" quotes often tricks people into using this on the command line,
while shell still expands $ inside of these.
2013-12-04 23:12:50 +01:00
wm4 f221d46a44 manpage: remove unhelpful paragraph about video filter params
This makes it sound like -1 would work to set the default for any
parameter. But this is just a (crappy) convention, which doesn't work
always.
2013-12-04 23:12:50 +01:00