Commit Graph

36571 Commits

Author SHA1 Message Date
wm4 370c5cc834 af: always remove auto-inserted filters, improve error message
It's probably better if all auto-inserted filters are removed when doing
an af_add operation. If they're really needed, they will be
automatically re-added.

Fix the error message. It used to be for an actual internal error, but
now it happens when format negotiation fails, e.g. when trying to use
spdif and real audio filters.
2013-11-09 01:27:03 +01:00
wm4 782c8e72ff vdpau: unbreak
Obviously I didn't test commit 1b8cd01, and it just crashed. Oops.
2013-11-09 01:27:03 +01:00
Stefano Pigozzi ed89332acf travis: remove e-mail notifications
Lately Travis sends out many notifications that are false positives caused by
timeout. We are annoyed.
2013-11-08 21:19:38 +01:00
wm4 6354a6b07d player: factor audio buffer clearing code
Note that the change in seek_reset is not entirely equivalent: we even
drop the remainder of buffered audio when seeking. This should be more
correct, because the whole point of the reset_ao parameter is to control
whether audio queued for output should be dropped or not.
2013-11-08 20:29:26 +01:00
wm4 8125252399 audio: don't let ao_lavc access frontend internals, change gapless audio
ao_lavc.c accesses ao->buffer, which I consider internal. The access was
done in ao_lavc.c/uninit(), which tried to get the left-over audio in
order to write the last (possibly partial) audio frame. The play()
function didn't accept partial frames, because the AOPLAY_FINAL_CHUNK
flag was not correctly set, and handling it otherwise would require an
internal FIFO.

Fix this by making sure that with gapless audio (used with encoding),
the AOPLAY_FINAL_CHUNK is set only once, instead when each file ends.
Basically, move the hack in ao_lavc's uninit to uninit_player.

One thing can not be entirely correctly handled: if gapless audio is
active, we don't know really whether the AO is closed because the file
ended playing (i.e. we want to send the buffered remainder of the audio
to the AO), or whether the user is quitting the player. (The stop_play
flag is overwritten, fixing that is perhaps not worth it.) Handle this
by adding additional code to drain the AO and the buffers when playback
is quit (see play_current_file() change).

Test case: mpv avdevice://lavfi:sine=441 avdevice://lavfi:sine=441 -length 0.2267  -gapless-audio
2013-11-08 20:00:58 +01:00
wm4 052a7d54ab audio: stop "unsupported sample format" spam
It spams these in verbose mode. It's caused by format negotiation code
in af.c. It's for the mpv format to ffmpeg-format case, and that one is
very uninteresting. (The ffmpeg supported audio formats are practically
never extended.)
2013-11-07 22:34:03 +01:00
wm4 de577d4e79 audio: fix bogus audio format comparison 2013-11-07 22:19:19 +01:00
wm4 1b8cd01b1a vdpau: drop dummy render function
This was supposed to handle preemption better. I still think the current
state isn't very nice, since the decoder can "accidentally" call the
previous render function after preemption (instead of calling the
reloaded function), so there might be issues. But all in all, this
dummy_render function is a bit confusing, and still not entirely
correct, so it's not worth it.
2013-11-07 22:17:35 +01:00
wm4 1889c62b85 af: remove a pointless macro
The code should be equivalent; a compatibility macro definition is left.
(It should be mass-replaced later.)
2013-11-07 22:15:44 +01:00
wm4 d74bac22b9 audio/format: convert format macros to enum, drop NE suffix
Turn the sample format definitions into an enum. (The format bits are
still macros.) The native endian versions of the new definitions don't
have a NE suffix anymore, although there are still compatibility defines
since too much code uses the NE variants.

Rename the format bits for special formats to help to distinguish them
from the actual definitions, e.g. AF_FORMAT_AC3 to AF_FORMAT_S_AC3.
2013-11-07 22:13:20 +01:00
wm4 91626b1c06 audio: replace af_fmt2str_short -> af_fmt_to_str
Also, remove all af_fmt2str usages.
2013-11-07 22:12:36 +01:00
wm4 aa48eeac97 audio/format: reformat 2013-11-07 22:12:26 +01:00
Rudolf Polzer 6c4b504eca encoding-example-profiles: support setsar in FFmpeg-git 2013-11-07 17:54:16 +01:00
Rudolf Polzer 633fde4ae5 sd_lavc, sd_spu: make dvdsub stretching conditional on --stretch-dvd-subs.
We found that the stretching - although it usually improves the looks of
the fonts - is incorrect.

On DVD, subtitles can cover the full area of the picture, and they have
the same pixel aspect as the movie itself.

Too bad many commercially released DVDs use bitmap fonts made with the
wrong pixel aspect (i.e. assuming 1:1) - --stretch-dvd-subs will make
these more pretty then.
2013-11-07 12:56:07 +01:00
Rudolf Polzer 49caa0a775 sd_ass, sd_lavc: use the input video's pixel aspect for scaling subtitles.
The previous code used the output video's pixel aspect for stretching
purposes, breaking rendering with e.g. -vf scale in the chain. Now
subtitles are stretched using the input video's pixel aspect only,
matching the intentions of the original subtitle author.
2013-11-07 12:56:07 +01:00
wm4 dbb7927a1e ao_oss: fix previous ao_oss commit
Basically I introduced an inverted condition, and the line removed was
inactive before commit ce72aaa.
2013-11-06 22:28:17 +01:00
Stefano Pigozzi 057c2e25b0 travis: use clang for ffmpeg/libav compilation
I overlooked the fact that the ffmpeg/libav build system only supports `--cc`
and completly ignores $CC. Hopefully this makes the build times a little
faster.

Fixes #332
2013-11-06 20:56:28 +01:00
wm4 ce72aaae7b ao_oss: hide warning 2013-11-06 20:33:48 +01:00
bugmen0t 9db560b9a9 ao_oss: don't enable -softvol by default on OSSv4 2013-11-06 20:31:38 +01:00
bugmen0t 0cffd98e8e ao_oss: make no_persistent_volume volume work when seeking 2013-11-06 20:31:36 +01:00
wm4 d445147be9 osdep: handle SIGTERM
There's no reason why we should e.g. handle SIGQUIT, but not SIGTERM.

Note that sending SIGTERM twice still kills the player.
2013-11-06 20:29:16 +01:00
wm4 ac01e6a147 input.conf: clarify the magic how default key bindings are added
This is a confusing mechanism, so the explanation should bit more clear.
2013-11-06 20:27:19 +01:00
wm4 ce8bc1320d memcpy_pic: reformat
Besides cosmetic changes, also change memcpy_pic return type and remove
config.h include.
2013-11-06 20:27:13 +01:00
wm4 6d2c5fc99a vd_lavc: remove explicit crystalhd support
This removes "--hwdec=crystalhd".

I doubt anyone even tried to use this. But even if someone wants to
use it, the decoders can still be explicitly invoked with e.g.:

    --vd=lavc:h264_crystalhd

The only advantage our special code provided was fallback to
software decoding. (But I'm not sure how the ffmpeg crystalhd
pseudo-decoder actually behaves.)

Removing this will allow some simplifications as soon as we don't need
vdpau_old.c anymore.
2013-11-06 00:47:53 +01:00
wm4 3cfbe81038 input: remove unused key_down_event command
There's no real use-case for this, and is wasn't documented (didn't even
appear on the "undocumented commands" list).
2013-11-06 00:08:38 +01:00
wm4 9dc0dfbd54 input: disallow autorepeat by default for most commands
This drops autorepeated key events for a number of commands. This should
help with slow situations accidentally triggering too many repeats. (I'm
not sure if this actually happened to users - maybe.)

It's not clear whether MP_CMD_COMMAND_LIST (multiple commands on one
binding separated by ';') should be repeated, or whether it should try
to do something clever. For now, disallow autorepeat with it.
2013-11-06 00:05:12 +01:00
wm4 01d12a51f1 gl_header_fixes: fix inverted condition
Could possibly leading to failing compilation on systems with headers
that miss the vdpau extension.
2013-11-05 22:39:19 +01:00
wm4 db6a4eec0a vo_opengl: support for vdpau hardware decoding
This uses vdpau OpenGL interop to convert a vdpau surface to a texture.

Note that this is a bit weak and primitive. Deinterlacing (or any other
form of vdpau postprocessing) is not supported. vo_opengl chroma scaling
and chroma sample position are not supported. Internally, the vdpau
video surfaces are converted to a RGBA surface first, because using the
video surfaces directly is too complicated. (These surfaces are always
split into separate fields, and the vo_opengl core expects progressive
frames or frames with weaved fields.)
2013-11-05 22:28:15 +01:00
wm4 5cca9143ab vdpau: move device and video surface management from vo_vdpau.c to vdpau.c
The goal is being able to use vdpau decoding independently from
vo_vdpau.c.
2013-11-05 22:13:05 +01:00
wm4 ff5a908328 vo_opengl: redo aspects of initialization, change hwdec API
Instead of checking for resolution and image format changes, always
fully reinit on any parameter change. Let init_video do all required
initializations, which simplifies things a little bit.

Change the gl_video/hardware decoding interop API slightly, so that
hwdec initialization gets the full image parameters.

Also make some cosmetic changes.
2013-11-05 22:05:23 +01:00
wm4 91472b84c2 vo_opengl/vaapi: use IMGFMT_RGB0
More correct, might make things slightly faster (probably
insignificant).
2013-11-05 22:05:23 +01:00
wm4 d6de87d1d3 video: make IMGFMT_RGB0 etc. exist even if libavutil doesn't support it
These formats are helpful for distinguishing surfaces with and without
alpha. Unfortunately, Libav and older version of FFmpeg don't support
them, so code will break. Fix this by treating these formats specially
on the mpv side, mapping them to RGBA on Libav, and unseting the alpha
bit in the mp_imgfmt_desc struct.
2013-11-05 22:05:23 +01:00
wm4 890d8ea194 manpage: fix incorrect default for --osc 2013-11-05 22:05:23 +01:00
wm4 7df03a1c9e vo_xv: fix compilation of SHM not available 2013-11-05 22:05:22 +01:00
Stefano Pigozzi f2d67a48c9 travis: update ffmpeg stable to 1.2.4 tarball
This is the last release in the 1.2.4 line.
2013-11-05 21:28:29 +01:00
Timothy Gu 327c88f4c9 travis: Update libav stable tarball
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-11-05 21:21:36 +01:00
wm4 ed02cbf92f playlist: rewrite PLS parser
Somehow the new parser ends up much smaller. Much of it is because we
don't parse some additional information. We just skip it, instead of
parsing it and then throwing it away.

More importantly, we use the physical order of entries, instead of
trying to sort them by entry number. Each "File" entry is followed by a
number that is supposed to be the entry number, and "File1" is first.
(Should it turn out that this is really needed, an additional field
should be added to playlist_entry, and then qsort().)
2013-11-04 23:55:41 +01:00
wm4 b74edd4069 demux_mkv: fix compiler warnings
Make TOOLS/matroska.pl output structs with fields sorted by name in
ebml_types.h to make the order of fields deterministic. Fix warnings in
demux_mkv.c caused by the first struct fields switching between scalar
and struct types due to non-deterministic ebml_types.h field order.
Since it's deterministic now, this shouldn't change anymore.

The warnings produced by the compilers are bogus, but we want to silence
them anyway, since this could make developers overlook legitimate
warnings.

What commits 7b52ba8, 6dd97cc, 4aae1ff were supposed to fix. An earlier
attempt sorted fields in the generated C source file, not the header
file. Hopefully this is the last commit concerning this issue...
2013-11-04 23:49:22 +01:00
Paweł Forysiuk f330884b0a Adjust wayland defines 2013-11-04 21:28:34 +01:00
wm4 2826dcff8f vdpau: drop required/deprecated access to a libavcodec struct field
Before the bitstream_buffers field was deprecated, you had to free it,
otherwise you would leak memory.

(Although vdpau.c uses a new API, they managed to introduce a new
deprecation this quickly. This is a complaint.)

This introduces a memory leak of 12 bytes per file on every file on some
_older_ libavcodec versions. This is minor enough that I don't care.
2013-11-04 19:59:03 +01:00
wm4 859964e0db stream_lavf: don't duplicate list of rtmp protocols
Assume a rtmp prefix means rtmp instead.
2013-11-04 19:57:39 +01:00
wm4 41fedab2d9 stream_lavf: support more libavformat protocols 2013-11-04 19:57:13 +01:00
wm4 bb22bee315 vo_opengl: cosmetics/fix typos 2013-11-04 19:46:28 +01:00
wm4 383d8a8b60 vo_opengl: reserve 4 texture units for video instead of 3
Video has up to 4 textures, if you include obscure formats with alpha.
This means alpha formats could always overwrite the first scaler
texture, leading to corrupted video display. This problem was recently
brought to light, when commit 571e697 started to explicitly unbind all 4
video textures, which broke rendering for non-alpha formats as well.

Fix this by reserving the correct number of texture units.
2013-11-04 19:46:15 +01:00
Stefano Pigozzi 78a9bc4a7d osx: fix -Wshadow warnings on platform specific code 2013-11-04 08:33:35 +01:00
Stefano Pigozzi 9087500179 Merge remote-tracking branch 'origin/have_configure' 2013-11-04 08:31:58 +01:00
wm4 5b6eab01af vo_opengl: fix use of uninitialized memory
Pretty bad, although it should actually not cause any misbehavior. Comes
from the hardware decoding interop commit.
2013-11-04 01:20:11 +01:00
wm4 3a831b2c01 fix HAVE_PTHREADS being undefined on windows 2013-11-04 00:48:43 +01:00
wm4 00de1320b0 fix HAVE_JACK being undefined
Holy inconsistency, let's just kill it with waf.
2013-11-04 00:48:29 +01:00
wm4 222cfe7fe6 define HAVE_COREAUDIO on platforms other than OSX 2013-11-04 00:43:47 +01:00