Commit Graph

33534 Commits

Author SHA1 Message Date
wm4 7cdfd2ba39 mplayer: change how pause status is indicated in terminal
Pausing the player used to print the message "=====  PAUSE  =====". It
also inserted a newline for some reason. When pausing and unpausing a
lot, the terminal would be clobbered with "old" useless status lines.

Remove the pause message, and display the status message instead. This
looks better, doesn't fill up the terminal with crap, and needs less
code.

Side note: when cache is enabled, the status line is reprinted on every
idle iteration to reflect possible cache changes. If the platform's
WAKEUP_PERIOD is very small (like on Windows) and terminal output is
slow (like on Windows), it's possible that this leads to a minor
performance degradation. This is probably not a problem (and I don't
care anyway), but maybe something that should be kept in mind.
Disabling the status line with --quiet will help.
2012-07-30 22:14:32 +02:00
wm4 4f86c0a3a4 mplayer: status line: better indication whether audio/video is active 2012-07-30 22:14:32 +02:00
wm4 1fde09db6f Remove some demuxers and decoders
Most of these demuxers and decoders are provided in better form by
libav, while the mplayer builtin ones are essentially unmaintained. The
only legimitate use case for not using the libav ones was working around
libav bugs or bugs related to the way mplayer uses libav. Instead of
trying to keep dead code alive, development effort should go into
improving libav or the mplayer libav glue code.

Note that the libav demuxer have been preferred over the mplayer builtin
ones for a while in mplayer2. There were some exceptions: playing DVDs
with dvdnav or playing network sources. (That's because some stream
modules and network.c requested explicit file formats, such as
DEMUXER_TYPE_MPEG_PS, which mapped to builtin demuxers.) With this
commit, they are switched to use libav. One caveat is that the requested
format is not passed to libavformat, instead we rely on the auto probing
to select the correct libav demuxer (see code in demux_open_stream()).
2012-07-30 22:14:32 +02:00
wm4 17b69493b7 libvo: remove exit_player_bad()
For some reason, these 3 VOs basically call exit() if something
went wrong.
2012-07-30 15:46:05 +02:00
wm4 bff71641f6 Merge remote-tracking branch 'origin/master' 2012-07-30 15:42:32 +02:00
wm4 6b4cdfe1c8 Remove XMMS plugin support
XMMS has been dead since 2007.
2012-07-30 02:19:50 +02:00
wm4 4d689631b8 options: remove some CONF_TYPE_PRINT placeholder options
Most of these printed "feature X is not implemented". Not very useful.
2012-07-30 02:14:27 +02:00
wm4 f867a97b48 mplayer: cosmetics: give A/V desync message same form as help text 2012-07-30 02:11:02 +02:00
wm4 eb75758138 mplayer: de-crapify builtin help text
Remove all the options that mattered in 2001 only. Use new option
syntax.
2012-07-30 02:06:39 +02:00
wm4 5c630c96cd options: rename --no-sound to --no-audio 2012-07-30 02:04:00 +02:00
wm4 d83211722e options: remove "no" options variants
The old option parser required adding two options for each flag option:
e.g. "-video" and "-novideo". Later, code was added to handle the "no-"
prefix automatically for flag options. Remove the "no" prefixed options
entirely (unless they are not flag options, then just rename them), and
require the user to use the "no-" prefix instead.

You can't use the old prefix anymore.

Old: -novideo
New: --no-video
2012-07-30 02:02:23 +02:00
wm4 128c5839ed mplayer: redo terminal status line output
Instead of displaying audio and video separately, there's now one
position printed. The idea is that displaying both audio and video
position is redundant. The A/V synchronisation is still printed, so
that you can see if the video time is off.

Also, always print the duration of the file, not only when playing
audio only.

Print "ct" (average A/V sync change) and the number of dropped frame
only if they're significant.

Remove output of outdated and crapified things, like frame position
(these can't be reasonably done with modern media formats, and the
playback code paths for these don't touch them).

This will break some slave mode applications, because they attempt to
parse the status line.
2012-07-30 01:49:35 +02:00
wm4 87cb5c683d mplayer: remove --autoq
Whatever that was, it has no use anymore.
2012-07-30 01:49:35 +02:00
wm4 0f48820ecc mplayer: remove benchmarking/CPU accounting code
The code used for benchmarking and showing CPU stats in the status line
was inaccurate, misleading and fragile. The final nail in the coffin is
the fact that many libav decoders are multithreaded now, and mplayer
couldn't possibly measure the CPU time consumed by them.

Add the --untimed option. This makes the video untimed, just like
--benchmark did (still requires disabling audio synchronization).
2012-07-30 01:49:35 +02:00
wm4 69c13af381 ass_mp.c: remap libass log levels
libass is way too chatty. The application using it shouldn't be forced
to print useless messages, especially not if the action was initiated
by the application, and libass successfully completes it.

Note that this might be a problem that should be fixed in libass, but
remapping the log levels is needed anyway (instead of relying on the
coincidence that the log level values are similar).
2012-07-30 01:49:35 +02:00
wm4 bf3b3d138d mplayer: remove extra "\n" in output 2012-07-30 01:49:26 +02:00
wm4 5404fa26f9 mplayer: do not print version by default
The msg level for the version output is elevated to verbose. When
running mplayer without arguments, the version is printed a second
time (with default msg level) before the help output.
2012-07-30 01:49:26 +02:00
wm4 f113e20794 ao_pulse: don't always print error message if PulseAudio unavailable
PulseAudio is rather high on the auto proving order (to avoid using an
emulated sound API), but it prints an annoying error message if the
PA client library can't connect to a server. On the other hand, we do
want this error message printed if the user explicitly selects the
pulse audio output driver.

Add a flag to indicate that an AO is opened due to auto probing.
ao_pulse checks that flag, and if it's set, do not print if the
initialization error is PA_ERR_CONNECTIONREFUSED, whcih I assume is
the error signalling PulseAudio unavailability. (This error happens
if no PulseAudio server is installed.)
2012-07-30 01:46:04 +02:00
wm4 d80b84f1a0 mixer: silence message about inserting volume filter
But only if softvol is enabled. Otherwise, it should be a warning.
2012-07-30 01:46:04 +02:00
wm4 caeff2b1be mixer: make softvol default, and raise softvol-max to 200
mplayer is not a mixer control panel.
2012-07-30 01:46:04 +02:00
wm4 cc0c0ef9b7 libmpcodecs: silence lines reading "AUDIO:" and "VIDEO:"
Both of these are not very interesting, and redundant with the
corresponding VO/AO initialization messages.
2012-07-30 01:46:04 +02:00
wm4 6d6ae638fa lirc: silence output in case LIRC can't be opened
By default mplayer attempts to use LIRC. If LIRC can't be opened, a
bunch of warnings are printed. Since mplayer is often built with LIRC
enabled by default, many users will see these rather pointless
warnings. Lower verbosity, so that the warnings are not visible by
default anymore.
2012-07-30 01:46:04 +02:00
wm4 d86216685b mplayer: silence "Starting playback..." output
This is just noise. Note that this _might_ break some applications
using slave mode.
2012-07-30 01:46:04 +02:00
wm4 c8b0f21154 codecs: prefer libmad over libmpg123
Someone on the internet once told me that MAD is the best mp3 decoder
(and better than mpg123), so he must be right. I used to force mad in
my config file, but now I'm annoyed by the line "Forced audio codec"
that goes along with it.

Because I think that message is necessary and needed to discourage
users from doing stupid things, but I still want to get rid of this
message, I'm simply moving MAD up in the codec selection order.
(Please look away.)
2012-07-30 01:45:08 +02:00
wm4 5b9d01bd49 vd: silence output about aspect ratio
Uninteresting.
2012-07-30 01:45:08 +02:00
wm4 93de744a2b sub: silence output of subtitle search message
This message is not so interesting.
2012-07-30 01:45:07 +02:00
wm4 521a598068 mplayer: let frontend print stream info, instead of demuxers
When playing a file, users (i.e. me) expect mplayer to print a list of
video/audio/subtitle streams. Currently, this is done in each demuxer
separately. This also means the output is formatted differently
depending which demuxer is active.

Add code to print an uniformly formatted streams list in the player
front end. Extend the streams headers to export additional information
about the streams. Change the lavf and mkv demuxers to follow this new
scheme, and raise the log level for the "old" printing functions.

The intention is to make every demuxer behave like this eventually.

The stream list output attempts to provide codec information. It's a
bit hacky and doesn't always provide useful output, and I'm not sure
how to do it better.
2012-07-30 01:42:55 +02:00
wm4 3daf32adfd mplayer: improve the A/V desync warning
Most of the tips that were given didn't help that much. The message
contained a reference to a dead file.
2012-07-30 01:42:55 +02:00
wm4 3c98615069 vo_gl, vo_gl3: honor global --vsync option
Both VOs will now by default try to set vsync according to the global
vsync setting. By default, vsync is enabled, and passing --no-vsync will
disable it.

The --vsync option used to matter for vo_vesa only, but that VO has been
removed.
2012-07-30 01:42:54 +02:00
wm4 614f847516 mplayer: remove Linux RTC support
This used /dev/rtc for timing. /dev/rtc root only by default, and I
have a hard time believing that the standard OS functions are not good
enough. (Even if not, support for POSIX high resolution timers should
be added instead, see clock_gettime() and others.)
2012-07-30 01:42:54 +02:00
wm4 7349d39938 configure, mp_msg.h: get rid of MP_DEBUG
The function mp_dbg() was silent if MP_DEBUG was not defined. MP_DEBUG
was defined only if configure was invoked with --enable-debug. Remove
it and make mp_dbg an alias to mp_msg. This has the advantage tha
--enable-debug changes less. (It only adds -g now and disables stripping
the binary on installation.)

Using log levels is the better way to silence annoying debug messages.
2012-07-30 01:40:42 +02:00
wm4 6009965cdd sub: remove unrar_exec
This removes the ability to open compressed bitmap subtitles from rar
files. The code makes me afraid, and I never needed this feature.
2012-07-30 01:40:42 +02:00
wm4 897d1c01bc mplayer: remove crash handler stuff
mplayer tries to catch all signals by default, and displays a "nice"
crash message if a signal is caught. This is mostly useless for
diagnosing problems, and it's extremely fragile. It's likely to cause
more harm than it possibly solves.

Also remove the current_module variable, which was supposed to give a
hint which submodule was being run. This was far from accurate or
useful.

mplayer also caught SIG_CHILD, and tried to wait for any children. This
potentially gets rid of zombies, but I'm not sure which ones. The only
places that fork(), cache2.c and unrar_exec.c, seem to wait for their
child processes properly. Just get rid of it.

Note that we don't even catch SIGTERM. Maybe this will have to be added
back in order to re-enable screensavers and such when the user
terminates mplayer with ^C on the terminal.
2012-07-30 01:38:53 +02:00
wm4 35291b8ad9 vf_scale: don't pass CPU flags anymore
libav detects them automatically.
Also fix a bunch of other VFs, which use the get_sws_cpuflags()
function defined by vf_scale.c.
2012-07-30 01:38:53 +02:00
wm4 43da1e78c4 Rip out 3DNOW support
Ancient AMD specific enhancement to the MMX instruction set. Officually
discontinued by AMD.

Note that support for this was already disabled in the previous commit.
This commit removes the actual code.
2012-07-30 01:38:14 +02:00
wm4 74df1d8e05 Remove compile time/runtime CPU detection, and drop some platforms
mplayer had three ways of enabling CPU specific assembler routines:
a) Enable them at compile time; crash if the CPU can't handle it.
b) Enable them at compile time, but let the configure script detect
   your CPU. Your binary will only crash if you try to run it on a
   different system that has less features than yours.
   This was the default, I think.
c) Runtime detection.

The implementation of b) and c) suck. a) is not really feasible (it
sucks for users). Remove all code related to this, and use libav's CPU
detection instead. Now the configure script will always enable CPU
specific features, and disable them at runtime if libav reports them
not as available.

One implication is that now the compiler is always expected to handle
SSE (etc.) inline assembly at runtime, unless it's explicitly disabled.

Only checks for x86 CPU specific features are kept, the rest is either
unused or barely used.

Get rid of all the dump -mpcu, -march etc. flags. Trust the compiler
to select decent settings.

Get rid of support for the following operating systems:
- BSD/OS (some ancient BSD fork)
- QNX (don't care)
- BeOS (dead, Haiku support is still welcome)
- AIX (don't care)
- HP-UX (don't care)
- OS/2 (dead, actual support has been removed a while ago)

Remove the configure code for detecting the endianness. Instead, use
the standard header <endian.h>, which can be used if _GNU_SOURCE or
_BSD_SOURCE is defined. (Maybe these changes should have been in a
separate commit.)

Since this is a quite violent code removal orgy, and I'm testing only
on x86 32 bit Linux, expect regressions.
2012-07-30 01:37:28 +02:00
wm4 a4bab723b3 fastmemcpy.h: remove code duplication
Remove the mem2agpcpy_pic function, which is obviously duplicated from
the other function in this file.

Untested, as this is only used by the directx and directfb2 VOs.
2012-07-30 01:36:35 +02:00
wm4 273a6623e7 libvo: remove custom assembler memcpy implementations (aka fastmemcpy)
aclib[_template].c contained inline assembler versions of memcpy using
MMX/SSE/3dnow etc. instructions. It's possible that this gave quite a
speed a decade ago, but it's unlikely to have any use on modern
systems. Also, libc implementations already have their own
optimizations for the native memcpy function.

I did not verify my assumptions eith benchmarks, so I could be wrong.

Also note that some platforms have extremely crappy libc
implementations, and it's well possible that these might suffer from a
major performance loss (hello Windows). Unfortunately, I do not care.
2012-07-30 01:33:40 +02:00
Uoti Urpala de435ed56e ao_pulse: work around PulseAudio timing bugs
Work around PulseAudio bugs more effectively. In particular, this
should avoid two issues: playback never finishing at end of file /
segment due to PulseAudio always claiming there's still time before
audio playback reaches the end, and jerky playback especially after
seeking due to bogus output from PulseAudio's timing interpolation
code.

This time, I looked into the PulseAudio code itself and analyzed the
bugs causing problems. Fortunately, two of the serious ones can be
worked around in client code. Write a new get_delay() implementation
doing that, and remove some of the previous workarounds which are now
unnecessary. Also add a pa_stream_trigger() call to ensure playback of
files shorter than prebuf value starts (btw doing that by setting a
low prebuf hits yet another PulseAudio bug, even if you then write the
whole file in one call).

There are still a couple of known PulseAudio bugs that can not be
worked around in client code. Especially, bug 4 below can cause issues
when pausing.

Below is a copy of a message I sent to the pulseaudio-discuss mailing
list, describing some of the PulseAudio bugs:

==================================================

A lot of mplayer2 users with PulseAudio have experienced problems. I
investigated some of those and confirmed that they are caused by
PulseAudio. There are quite a few distinct PulseAudio bugs; some are
analyzed below. Overall, however, I wonder why there are so many fairly
obvious bugs in a widely used piece of software. Is there no
maintenance? Or do people not test it? Some of the bugs are probably
less obvious if you request low latency (though they're not specific to
higher-latency case); do people test the low-latency case only?

1. The timing interpolation functionality can return completely bogus
values for playback position and latency, especially after seeking
(mplayer2 does cork / flush / uncork, as flushing alone does not seem to
remove data already in sink). I've seen quickly repeated seeks report
over 10 second latency, when there aren't any buffers anywhere that big.
I have not investigated the exact cause. Instead I disabled
interpolation and added code to always call
pa_stream_update_timing_info(). (I assume that always waiting for this
to complete, instead of doing custom interpolation, may give bad
performance if it queries a remote server. But at least it works better
locally.)

2. Position/latency reporting is wrong at the end of a stream (after the
lack of more data triggers underflow status). As a result mplayer2 never
ends the playback of a file, as it's waiting forever for audio to finish
playing. The reason for this is that the calculations in PulseAudio add
the whole length of data in the sink to the current latency (subtract
from position), even if the sink does not contain that much data *from
this stream* in underflow conditions. I was able to work around this bug
by calculating latency from pa_timing_info data myself as follows
(ti=pa_timing_info):

    int64_t latency = pa_bytes_to_usec(ti->write_index - ti->read_index, ss);
    latency -= ti->transport_usec;
    int64_t sink_latency = ti->sink_usec;
    if (!ti->playing)
        // this part is missing from PulseAudio itself
        sink_latency -= pa_bytes_to_usec(ti->since_underrun, ss);
    if (sink_latency > 0)
        latency += sink_latency;
    if (latency < 0)
        latency = 0;

However, this still doesn't always work due to the next bug.

3. The since_underrun field in pa_timing_info is wrong if PulseAudio is
resampling the stream. As a result, the above code indicated that the
playback of a 0.1 second 8-bit mono file would take about 0.5 seconds.
This bug is in pa_sink_input_peek(). The problematic parts are:

ilength = pa_resampler_request(i->thread_info.resampler, slength);
...
if (ilength > block_size_max_sink_input)
    ilength = block_size_max_sink_input;
...
pa_memblockq_seek(i->thread_info.render_memblockq, (int64_t) slength, PA_SEEK_RELATIVE, TRUE);
...
i->thread_info.underrun_for += ilength;

This is measuring audio in two different units, bytes for
resampled-to-sink (slength) and original stream (ilength). However, the
block_size_max_sink_input test only adjusts ilength; after that the
values may be out of sync. Thus underrun_for is incremented by less than
it should be to match the slength value used in pa_memblockq_seek.

4. Stream rewind functionality breaks if the sink is suspended (while
the stream is corked). Thus, if you pause for more than 5 seconds
without other audio playing, things are broken after that. The most
obvious symptom is that playback can continue for a significant time
after corking. This is caused by sink_input and sink getting out of
sync. First, after uncorking a stream on a suspended sink,
pa_sink_input_request_rewind() is called while the sink is still in
suspended state. This sets sink_input->thread_info.rewrite_nbytes to -1
and calls pa_sink_request_rewind(). However, the sink ignores rewind
requests while suspended. Thus this particular rewind does nothing. The
problem is that rewrite_nbytes is left at -1. Further calls to
pa_sink_input_request_rewind() do nothing because "nbytes =
PA_MAX(i->thread_info.rewrite_nbytes, nbytes);" sets nbytes to -1, and
the call to pa_sink_request_rewind() is under "if (nbytes != (size_t)
-1) {". Usually, after a sink responds to a rewind request,
rewrite_bytes is reset in pa_sink_input_process_rewind(), but this
doesn't happen if the sink ever ignores one request. This broken state
can be resolved if pa_sink_input_process_rewind() is called due to a
rewind triggered by _another_ stream.

There were more bugs, but I'll leave those for later.
2012-07-29 22:03:21 +03:00
wm4 94b7db20bc configure: remove pointless checks for yasm etc.
mplayer doesn't use yasm, as or ranlib. They were only needed to
build with internal libav, which is gone.

Also, get rid of nm. nm was used to find out how external symbols are
mangled. Replace this by a platform check in mangle.h. As far as I
know, sane systems don't mangle symbols. Windows prefixes them with
an underscore ("_symbol"). I don't know about OSX.
2012-07-29 00:22:13 +02:00
wm4 46b218ca34 Change version string
Change the "main" name from "mplayer2" to "mplayer". Note that upstream
mplayer2 uses "MPlayer2", and mplayer uses "MPlayer", so it's
unambiguous.

The version.sh script used to put the latest tag into the version
script. The intention was to add a new tag on each release, but this
hasn't been done in over a year, making the tag absolutely pointless.
Remove it. Now "git-SHORTHASH" is used.

Remove the string "MPlayer & mplayer2 teams" after the copyright date,
because that sounded silly.
2012-07-29 00:04:17 +02:00
wm4 806461c5b6 ad_faad: include neaacdec.h instead of faad.h
The faad.h header printed a warning that this header is outdated.
The header neaacdec.h is probably the proper header, so use that.
2012-07-28 23:51:38 +02:00
wm4 08caadb9c0 bstr: rename bstr() function to bstr0(), and typedef bstr to struct bstr
Replace all uses of bstr() with bstr0().
Also remove the ridiculous C++ workaround.
2012-07-28 23:47:42 +02:00
wm4 ca0979a5db configure: disable win32 emulation by default
The win32 emulation code can be used to load Windows binary codecs.
Unfortunately, this code is extremely whacky and unmaintained. It
consists of an ancient copy of wine, that was hacked to death and
back. It does super-whacky stuff like patching the loaded codecs at
fixed memory offsets to make them work.

Not removing yet, because it still has some limited use, and some of
the code is needed to load codecs when running natively on Windows.
(Actually, I only care because mplayer can get video input from the
webcam of that-one-latop under Windows, which I find far too neat to
just kill all the code.)
2012-07-28 23:36:08 +02:00
wm4 71e51d948c osd: osd_font.h -> osd_font.pfb
osd_font.pfb is an actual font file extracted from osd_font.h.
file2string.py is used to turn it back into a header during the
build process.
2012-07-28 23:36:08 +02:00
wm4 1ee740cceb TOOLS/fil2string.py: fix for use with binary files
The script was written to be able to deal with binary files, but it had
a bug corrupting some data: e.g. a byte sequence 0x1 0x37 was printed as
"\17" (0x1 = escaped as "\1", and 0x37 = kept as literal "7"), which
would be interpreted as single character 0xF.

Always pad octal literals to length 3, which makes the escape sequences
unambiguous.
2012-07-28 23:36:08 +02:00
wm4 85a3a0d5bc osd: remove freetype font rendering code
The previous commit made libass the default OSD renderer. This commit
removes the disabled freetype renderer completely. The commits were
done separately to make rolling back easier, because using libass for
OSD rendering is a risky choice.

Also remove freetype/fontconfig/fribidi code. This is all done by
libass now.

If mplayer is compiled without libass, no OSD is displayed.
2012-07-28 23:36:08 +02:00
wm4 74e7a1e937 osd: use libass for OSD rendering
The OSD will now be rendered with libass. The old rendering code, which
used freetype/fontconfig and did text layout manually, is disabled. To
re-enable the old code, use the --disable-libass-osd configure switch.

Some switches do nothing with the new code enabled, such as -subalign,
-sub-bg-alpha, -sub-bg-color, and many more. (The reason is mostly that
the code for rendering unstyled subtitles with libass doesn't make any
attempts to support them. Some of them could be supported in theory.)

Teletext rendering is not implemented in the new OSD rendering code. I
don't have any teletext sources for testing, and since teletext is
being phased out world-wide, the need for this is questionable.

Note that rendering is extremely inefficient, mostly because the libass
output is blended with the extremely strange mplayer OSD format. This
could be improved at a later point.

Remove most OSD rendering from vo_aa.c, because that was extremely
hacky, can't be made work with osd_libass, and didn't work anyway in
my tests.

Internally, some cleanup is done. Subtitle and OSD related variable
declarations were literally all over the place. Move them to sub.h and
sub.c, which were hoarding most of these declarations already. Make the
player core in mplayer.c free of concerns like bitmap font loading.

The old OSD rendering code has been moved to osd_ft.c. The font_load.c
and font_load_ft.c are only needed and compiled if the old OSD
rendering code is configured.
2012-07-28 23:36:07 +02:00
wm4 7a06095dc3 Add support for playing video from streaming sites with libquvi
This enables playing URLs from libquvi supported streaming sites
directly, e.g. "mplayer http://www.youtube.com/watch?v=...."

Anything opened with mplayer is checked with libquvi. If it looks like
a URL of a supported streaming site, libquvi is used to extract the
media URL, which is then passed to the lower level mplayer code
instead of the HTML URL. Hopefully the libquvi URL checker works well
enough that it doesn't cause any problems with normal URLs, files, or
whatever else mplayer's stream layer accepts.

Add the --libquvi-format option. the option value is directly passed to
libquvi as requested format. The only values that seem to work for any
streaming site seem to be "best" (best quality) and "default" (lowest
quality). The mplayer option defaults to "best" (overriding libquvi's
default).

Outstanding issues:
- Does libquvi checking every opened file really not cause problems?
  Should there be a runtime option to disable libquvi use?
  (Probably not an issue.)
- Should we check/set the supported protocol? By default libquvi has
  support for all protocols enabled. In the worst case, it might return
  an URL using a protocol not supported by mplayer, even though it
  could extract URLs with other protocols too.
  (Probably not an issue.)
- Somehow export metadata (like media title) to the mplayer frontend?
2012-07-28 22:05:34 +02:00
wm4 42c3a30008 commands: add show_tracks_osd command to display audio and subtitle tracks on OSD
The command lists the audio and subtitle tracks in the current file on the
OSD. It also marks the currently active streams.
Video streams are not shown, as files with more than one video stream are
exceedingly rare.
2012-07-28 20:57:44 +02:00