Commit Graph

41664 Commits

Author SHA1 Message Date
wm4 dbbac7b3e1 demux: mime types are case-insensitive
This one is used for demux_mf and for dmeux_mkv image attachments.
2015-06-21 18:21:21 +02:00
wm4 0316f5514e demux_mkv: share some duplicated code
As a side effect, video tracks now actually export some fields
(language, default flag) to the player.
2015-06-21 18:19:10 +02:00
wm4 be882175d8 demux: merge extradata fields
MPlayer traditionally had completely separate sh_ structs for
audio/video/subs, without a good way to share fields. This meant that
fields shared across all these headers had to be duplicated. This commit
deduplicates essentially the last remaining duplicated fields.
2015-06-21 18:06:14 +02:00
wm4 c66be698cd demux_mkv: minor audio extradata cleanup
Always use the already existing extradata[_len] variable, instead of the
awkward switch between manually changed extradata and falling back to
passing through extradata at the end.
2015-06-21 17:49:43 +02:00
wm4 2b64eee8d5 demux: rename sh_stream.format to sh_stream.codec_tag
Why not. "format" sounds too misleading for the actual importance and
meaning of this field.
2015-06-21 16:56:35 +02:00
wm4 991af7dfb1 video: reduce error message when loading hwdec backend fails
When using --hwdec=auto, about half of all systems will print:

    "[vdpau] Error when calling vdp_device_create_x11: 1"

this happens because usually mpv will be linked against both vdpau and
vaapi libs, but the drivers are not necessarily available. Then trying
to load a driver will fail. This is a normal part of probing, but the
error messages were printed anyway. Silence them by explicitly
distinguishing probing.

This pretty much goes through all the layers. We actually consider
loading hw backends for vo_opengl always "auto probed", even if a hw
backend is explicitly requested. In this case vd_lavc will print a
warning message anyway (adjust this message a bit).
2015-06-20 22:26:57 +02:00
wm4 b17b8ff7fe x11: make screensaver failure message slightly more friendly 2015-06-20 21:55:15 +02:00
wm4 23b83c6676 client API: allow using msg-level option for log messages
Client API users can enable log output with mpv_request_log_messages().
But you can enable only a single log level. This is normally enough, but
the --msg-level option (which controls the terminal log level) provides
more flexibility. Due to internal complexity, it would be hard to
provide the same flexibility for each client API handle. But there's a
simple way to achieve basically the same thing: add an option that sends
log messages to the API handle, which would also be printed to the
terminal as by --msg-level.

The only change is that we don't disable this logic if the terminal is
disabled. Instead we check for this before the message is output, which
in theory can lower performance if messages are being spammed. It could
be handled with some more effort, but the gain would be negligible.
2015-06-20 21:40:47 +02:00
wm4 34fce974c6 av_log: skip prefix if unknown
This happens with av_log(NULL, ...) calls. Drop the "?: " fallback
prefix, because it was confusing.

(Of course FFmpeg should not do this at all, but it's a very long way to
making the FFmpeg log callback sane.)
2015-06-20 17:02:56 +02:00
wm4 4e1159c3f2 demux_playlist: make mime type comparison case-insensitive
That's how mime types are.

(This makes redirection with a specific HLS URL work, because some idiot
thought it'd be a great idea to spell the mime type as
"application/x-mpegURL".)
2015-06-20 16:36:22 +02:00
wm4 da9e0988a6 win32: remove a wine hack
No particular reason, but it's still possible that it causes additional
corner cases, and it's not really needed to test this on wine (other
than testing fullscreen stuff, which should be done on a real Windows
anyway).
2015-06-20 14:32:14 +02:00
wm4 91fdfd3880 win32: prefer using internal variable for fullscreen
No particular reason, but since we already have an internal variable,
it's better than using the option struct, which will be redone sooner
or later.
2015-06-20 14:29:17 +02:00
wm4 09eaaf3f2c demux_mkv: do not reset bits_per_coded_sample if not needed 2015-06-19 21:48:19 +02:00
wm4 b789acee21 demux_mkv: do not set block_align for codecs which do not need it
These decoders do not reference it. I suspect this was originally done
for the sake for MPlayer's vfw/dshow wrappers.
2015-06-19 21:47:11 +02:00
wm4 f2cc6ce356 demux_mkv: do not set bitrate fields for codecs which do not need it
The only decoders I could find and which (possibly) require this field
are codecs which can be used via VfW only, and realaudio sipr. For VfW
we still passthrough this field.
2015-06-19 21:46:32 +02:00
wm4 8b44be54e7 demux_mkv: stricter realaudio extradata handling
Verify memory accesses and such. The behavior should be equivalent.

(RealAudio causes pain for everyone even in its grave.)
2015-06-19 21:43:55 +02:00
wm4 fd557a0178 demux_mkv: separate generic and non-VfW audio codec handling parts
Native Matroska codec support has to map the Matroska codec IDs to
libavcodec ones, and also has to undo codec-specific Matroska
strangeness, such as restoring AAC extradata and realaudio handling. The
VfW codec support doesn't need it, because AVI maps well enough to
libavcodec conventions (possibly because AVI was a dominant codec when
libavcodec was created). But there's still some need for generic codec
handling, such as enabling parsers and messing with various codec
parameters.

Separate these two, and move the parts which are guaranteed not to be
needed by VfW to the if-else tree that handles the VfW case
("A_MS/ACM"), making the cases exclusive.

(This should probably be done more radically, since it's very unlikely
that we should or have to mess with the VfW parameters at all - they
should just be passed through to the decoder.)
2015-06-19 21:42:55 +02:00
wm4 f544cd0501 demux_mkv: remove indirection through defines
This is actually more readable. Most of the defines are used only once,
so using a symbol instead of the direct string only obfuscated it.
2015-06-19 21:41:57 +02:00
wm4 0641ec0525 demux_mkv: remove FourCCs from audio codec handling
This removes the last traces of the old MPlayer FourCC-based codec
mapping code. Forcing all codec IDs through a FourCC table and then
back to codec names was confusing at best, so this is a nice cleanup.

Handling of PCM (non-VfW case) is redone to some degree.

Handling of AC3 is moved below realaudio handling, since "A_REAL/DNET"
is apparently AC3, and we must not skip realaudio-specific handling.
(It seems unlikely that anything would actually break, but on the other
hand I don't have any A_REAL/DNET samples for testing.)

Instead of explicitly matching all the specific AAC codec names, just
match them all as prefix.

Some codecs don't need special handling other than their mapping
entries, so they fall away (like Vorbis and Opus).

The prores check in mkv_parse_and_add_packet() is not strictly related
to this, but is done for consistency with the wavpack check above.
2015-06-19 21:39:59 +02:00
Teoh Han Hui aed7c84840 osc: time display configuration options
Total time and ms
2015-06-19 21:33:44 +02:00
wm4 b1a56d11fe player: add some debug output for seeking 2015-06-18 22:31:55 +02:00
wm4 d328b2088c player: actually play video
Broken by e00e9d65.
2015-06-18 20:48:30 +02:00
Marcin Kurczewski 797277a233 Various spelling fixes
Signed-off-by: wm4 <wm4@nowhere>
2015-06-18 19:36:58 +02:00
wm4 0f0e88cbaa DOCS/compile-windows.md: fix Lua package
mingw-w64-x86_64-lua maps to Lua 5.3, which we do not support. Change it
to mingw-w64-x86_64-lua51.
2015-06-18 18:41:09 +02:00
wm4 32955d3529 client API: fix logging memory leak
Very stupid.

Was pointed out in #2056.
2015-06-18 18:40:12 +02:00
wm4 e00e9d651b player: make decoding cover art more robust
When showing cover art, the decoding logic pretends that the source has
an infinite number of frames. This slightly simplifies dealing with
filter data flow. It was done by feeding the same packet repeatedly to
the decoder (each decode run produces new output).

Change this by decoding once at the video initialization. This is easier
to follow, and increases robustness in case of broken images. Usually,
we try to tolerate decoding errors, so decoding normally continues, but
in this case it would just burn the CPU for no reason.

Fixes #2056.
2015-06-18 18:39:46 +02:00
rrooij a87b18aa5a DOCS/manpage: fix typos
Fix some errors in the man pages by spell checking them. Most of them
were typos.

Signed-off-by: wm4 <wm4@nowhere>
2015-06-17 20:13:34 +02:00
wm4 f53135ffea av_log: set default av_log callback on exit
This is slightly "dangerous", because it could overwrite a log callback
another library has set, after we've set our own callback. But it's
probably still slightly better than leaving our own callback, which will
run the fallback code if no mpv instance is set. (Multiple mpv instances
sharing the same global state will safely avoid overwriting each other's
log callback.)

Note that we can't do much better, because the global state in FFmpeg is
obviously insane.
2015-06-17 14:52:31 +02:00
wm4 d4aaf29a05 ao_wasapi: fix crash on hotplug init error
On init error, the mp_msg macros are actually called. They could cause
a crash because state->log was NULL.
2015-06-17 13:42:31 +02:00
wm4 762623cdef af_lavrresample: include osdep/endian.h
The 24 bit conversion code needs the relevant preprocessor symbols.
2015-06-17 13:41:45 +02:00
wm4 72808be6f8 command: do not exit playback if the B point of A-B loop is past EOF
The previous behavior is confusing if the B point is near EOF (consider
B being the duration of the file, which is strictly speaking past the
last video timestamp). The new behavior is fine as well for B being far
past EOF.

Achieve this by checking the EOF state in addition to whether playback
has reached the B point. Also, move the A-B loop code out of
command_event(). It just isn't useful anymore, and obfuscates the code
more than it makes it loop simple.

Fixes #2046.
2015-06-16 23:11:14 +02:00
wm4 dbdc46c97a player: do not exit when a seek gets queued
Seems logical.

Note that if playback otherwise ends while playback is active and a seek
is still queued, we still exit. Otherwise you couldn't end playback by
seeking past the end of the file (which is classic MPlayer and mpv
behavior).
2015-06-16 23:07:46 +02:00
wm4 b2781c11ed af: remove conversion filter search
This attempted to find a minimal filter graph for a format conversion
involving multiple conversion filters. With the last 2 commits it
becomes dead code - remove it.
2015-06-16 22:49:21 +02:00
wm4 552dc0d564 af_convert24: remove this filter 2015-06-16 22:40:37 +02:00
wm4 5a9f817bfd af_lavrresample: integrate 24 bit (3 bytes per sample) output
Now af_lavrresample can output 24 bit samples directly, by doing the
conversion "inline". Luckily, S32->S24 can be done in-place, so this
isn't too much work. But the output conversion logic (which seems to be
adding up) gets slightly more complicated again.

Normally this is done by af_convert24. But having multiple conversion
filters complicates some aspects of the filter chain. S24 output is the
only thing the code for multiple conversion filters is still needed for,
and getting rid of that is preferable.
2015-06-16 22:38:37 +02:00
wm4 8ee9c170be af_lavrresample: always fill reorder
If the code path for additional output conversion is active,
reorder_planes() is always called, even if the reorder_out array wasn't
filled. This is obviously wrong - always fill this array.
2015-06-16 21:40:29 +02:00
wm4 831d7c3c40 audio: remove S8, U16, U24, U32 formats
They are useless. Not only are they actually rarely in use; but
libavcodec doesn't even output them, as libavcodec has no such sample
formats for decoded audio.

Even if it should happen that we actually still need them (e.g. if doing
direct hardware output), there are better solutions. Swapping the sign
is a fast and lossless operation and can be done inplace, so AO actually
needing it could do this directly.

If you wonder why we keep U8 instead of S8: because libavcodec does it.
2015-06-16 21:11:59 +02:00
wm4 488ebdb0d5 DOCS/compile-windows.md: drop unused dependency 2015-06-16 17:34:38 +02:00
wm4 82ff32ffac audio: fix crash on uninit
Shit.
2015-06-15 20:28:05 +02:00
wm4 30f5ba9422 af_lavcac3enc: fix A/V sync
The filter can buffer singificant amounts of audio.

(The proper fix is making the filter chain PTS-aware.)
2015-06-15 14:33:48 +02:00
wm4 74a73752c2 af: fix an aspect of filter chain flushing
Even if we flush the current filter, we have to read the remaining
output from the frame we previously fed to the filter.
2015-06-15 14:33:07 +02:00
wm4 5eae20fc0f audio: remove unused readonly field
Its last use was removed in 433402b5.
2015-06-15 14:32:14 +02:00
wm4 ec72feaba3 win32: use atomics for COM interface refcount 2015-06-14 17:56:24 +02:00
wm4 725d840b73 demux_mkv: always copy video extradata
The existing code avoided doing this for some codecs. I see no point in
this, and it seems the original reason this exists was due to some
cleanup in 2007. libavformat doesn't do this. So just drop it.
2015-06-13 22:34:23 +02:00
wm4 d50e01d0c6 demux_mkv: fix mpeg2 mapping
It's well possible that we've always ended up invoking the
AV_CODEC_ID_MPEG1VIDEO codec, but it's hard to tell. Mangling everything
through FourCCs (and then back) makes it hard to analyze. Also,
libavformat's Matroska demuxer uses AV_CODEC_ID_MPEG2VIDEO here, so it
should be quite safe to do anyway.
2015-06-13 22:34:23 +02:00
wm4 fd88fb70af demux_mkv: remove FourCCs from video codec handling
Inherited from MPlayer times, we used FourCCs to identify video codecs.
This was later changed to libavcodec codec names (which made life a
whole lot simpler). But demux_mkv still uses FourCCs a lot.

Change this for video. It's pretty simple, because some preparation was
done in the past. We just have to replace some "internal" FourCCs with
different handling.

One potentially complicated issue is that there is no natural way to
set the sh->format (AVCodecContext.codec_tag) field anymore. Most
decoders do not need it, though mjpeg is an exception.

Note that the AVI compatibility code still requires codec mappings, but
these are provided by FFmpeg. Also, the audio code is not changed.

For the MKV_V_MPEG2 -> mpeg1video thing see next commit.
2015-06-13 22:34:23 +02:00
wm4 b33ab743e5 demux_mkv: remove a level of indentation
Replace an else block with a nested if with just "else if". No
functional or other changes.
2015-06-13 21:27:00 +02:00
wm4 efa6d0c746 demux_mkv: remove ms_compat code
Reduces the mess slightly.
2015-06-13 21:17:48 +02:00
Marcin Kurczewski 8d6c22def4 vo_drm: fixed crashes with --profile=pseudo-gui 2015-06-13 16:18:11 +02:00
Stefano Pigozzi 63e4cb5163 test: update cmocka version to 1.0 2015-06-13 00:01:58 +02:00