Commit Graph

855 Commits

Author SHA1 Message Date
wm4 16145ff43f libvo, libao: remove useless video and audio output drivers
Some of these have only limited use, and some of these have no use at
all. Remove them. They make maintainance harder and nobody needs them.
It's possible that many of the removed drivers were very useful a dozen
of years ago, but now it's 2012.

Note that some of these could be added back, in case they were more
useful than I thought. But right now, they are just a burden.

Reason for removal for each module:
    vo_3dfx, vo_dfbmga, vo_dxr3, vo_ivtv, vo_mga, vo_s3fb,
    vo_tdfxfb, vo_xmga, vo_tdfx_vid:
        All of these are for very specific and outdated hardware. Some
        of them require non-standard kernel drivers or do direct HW
        access.
    vo_dga: the most crappy and ancient way to get fast output on X.
    vo_aa: there's vo_caca for the same purpose.
    vo_ggi: this never lived, and is entirely useless.
    vo_mpegpes: for DVB cards, I can't test this and it's crappy.
    vo_fbdev, vo_fbdev2: there's vo_directfb2
    vo_bl: what is this even? But it's neither important, nor alive.
    vo_svga, vo_vesa: you want to use this? You can't be serious.
    vo_wii: I can't test this, and who the hell uses this?
    vo_xvr100: some Sun thing.
    vo_xover: only useful in connection with xvr100.
    ao_nas: still alive, but I doubt it has any meaning today.
    ao_sun: Sun.
    ao_win32: use ao_dsound or ao_portaudio instead.
    ao_ivtv: removed along vo_ivtv.

Also get rid of anything SDL related. SDL 1.x is total crap for video
output, and will be replaced with SDL 2.x soon (perhaps), so if you
want to use SDL, write output drivers for SDL 2.x.

Additionally, I accidentally damaged Sun support, which made me
completely remove Sun/Solaris support. Nobody cares about this anyway.

Some left overs from previous commits removing modules were cleaned up.
2012-07-28 20:44:59 +02:00
wm4 2793e7eb70 Merge remote-tracking branch 'origin/master' 2012-05-20 11:42:44 +02:00
Uoti Urpala e5f8ab3bca ao_arts, ao_esd: remove these AOs
Delete ao_arts and ao_esd. Both have been deprecated upstream.
2012-05-06 18:29:48 +03:00
Uoti Urpala 3076dd8199 build: remove IRIX support 2012-05-06 18:22:34 +03:00
wm4 cd21ce3779 ao_portaudio: add new PortAudio audio output driver
This AO has potential to be useful on platforms other than Linux. On
Windows in particular, PortAudio can make use of newer/better audio
APIs like WASAPI, instead of DirectSound.

As an implementation choice, the PortAudio callback API was used. The
blocking API might be a better match for mplayer's requirements, but
caused severe problems on Linux/ALSA (possibly PortAudio bugs).
2012-05-06 17:57:44 +03:00
Uoti Urpala bb90802717 ao_pulse: fix specifying host/sink after 4fed8ad197
Commit 4fed8ad197 ("ao_pulse: convert to new AO API") failed to change
the variable name used on one line in suboption handling. This caused
a crash due to NULL dereference if you tried to specify any suboptions
for the AO (as in "--ao=pulse:foo"). Fix.
2012-05-03 23:45:57 +03:00
wm4 87f4cafe9c Merge remote-tracking branch 'origin/master'
Conflicts:
	command.c
	libao2/ao_alsa.c
	libao2/ao_dsound.c
	libao2/ao_pulse.c
	libao2/audio_out.h
	mixer.c
	mixer.h
	mplayer.c

Replace my mixer changes with uau's implementation, which is based on
my code.
2012-04-28 00:54:26 +02:00
wm4 1324eaece0 ao_openal: fix crash when no device parameter is passed 2012-04-25 02:20:37 +02:00
wm4 47371bdb94 Merge remote-tracking branch 'origin/master'
Conflicts:
	libvo/vo_kva.c
2012-04-13 17:45:27 +02:00
wm4 086d0381f0 ao_coreaudio: fix partial volume control
If digital pass-through is used, this supported setting the volume
(just mute, actually), but not getting the volume. This will probably
lead to a stuck mute state in the mplayer frontend. Make the code
respond to volume queries even if digital pass-through is used.
2012-04-11 03:56:30 +03:00
wm4 fc8db0ca88 ao_pulse: support native mute control 2012-04-11 03:56:30 +03:00
wm4 b5636c3ac6 ao_alsa: support native mute control 2012-04-11 03:56:30 +03:00
Uoti Urpala 39aa7d9846 mixer: support native audio driver mute
Make mixer support setting the mute attribute at audio driver level,
if one exists separately from volume. As of this commit, no libao2
driver exposes such an attribute yet; that will be added in later
commits.

Since the mute status can now be set externally, it's no longer
completely obvious when the player should automatically disable mute
when uninitializing an audio output. The implemented behavior is to
turn mute off at uninitialization if we turned it on and haven't
noticed it turn off (by external means) since.
2012-04-11 03:56:28 +03:00
Uoti Urpala 87dad2a470 audio: restore volume setting after AO reinit if needed
MPlayer volume control was originally implemented with the assumption
that it controls a system-wide volume setting which keeps its value
even if a process closes and reopens the audio device. However, this
is not actually true for --softvol mode or some audio output APIs that
only consider volume as a per-client setting for software mixing. This
could have annoying results, as the volume would be reset to a default
value if the AO was closed and reopened, for example whem moving to a
new file or crossing ordered chapter boundaries. Add code to set the
previous volume again after audio reinitialization if the current
audio chain is known to behave this way (softvol active or the AO
driver is known to not keep persistent volume externally).

This also avoids an inconsistency with the mute flag. The frontend
assumed the mute status is persistent across file changes, but it
could be similarly lost.

The audio drivers that are assumed to not keep persistent volume are:
coreaudio, dsound, esd, nas, openal, sdl. None of these changes have
been tested. I'm guessing that ESD and NAS do per-connection
non-persistent volume settings.

Partially based on code by wm4.
2012-04-11 03:50:31 +03:00
Uoti Urpala 3a01606dc0 libao2: change control() types to enum, remove unused ones
Change the audio driver control() command argument from "int" to "enum
aocontrol". Remove unused control types (SET_DEVICE, GET_DEVICE,
QUERY_FORMAT, SET_PLUGIN_DRIVER, SET_PLUGIN_LIST). The QUERY_FORMAT
one looks like there's a possibility such functionality could be
useful in the future, but as ao_oss was the only driver to have an
actual implementation of it, the current code wasn't worth keeping.
2012-04-08 16:35:09 +03:00
wm4 485f439cfe ao_alsa: use "Master" mixer channel instead of "PCM" by default
Do this, because the "Master" channel normally provides proper mute
control.

The old default can be forced with: --mixer-channel=PCM
2012-04-08 16:17:35 +03:00
Uoti Urpala e2fc1f640f build: remove OS/2 support 2012-04-06 17:45:56 +03:00
wm4 1aa2e36122 Merge remote-tracking branch 'origin/master'
Conflicts:
	bstr.c
	bstr.h
	etc/input.conf
	input/input.c
	input/input.h
	libao2/ao_pulse.c
	libmpcodecs/vf_ass.c
	libmpcodecs/vf_vo.c
	libvo/gl_common.c
	libvo/x11_common.c
	mixer.c
	mixer.h
	mplayer.c
2012-04-01 22:52:33 +02:00
Uoti Urpala 81de9a52d0 ao_pulse: add hacks to work around seek problems
pa_stream_flush() seems to work pretty badly in general. The visible
symptoms included at least old audio continuing for a significant time
after the call, and bogus latency reporting causing temporary video
freezes after a seek. Add some hacks to work around these problems.
The result seems to work most of the time on my machine at least...
2012-03-26 03:55:31 +03:00
Uoti Urpala a0de4bc500 ao_pulse, core: make pulse thread wake up core for more data
For ao_pulse, the current latency is not a good indicator of how soon
the AO requires new data to avoid underflow. Add an internal pipe that
can be used to wake up the input loop from select(), and make the
pulseaudio main loop (which runs in a separate thread) use this
mechanism when pulse requests more data. The wakeup signal currently
contains no information about the reason for the wakup, but audio
buffers are always filled when the event loop wakes up.

Also, request a latency of 1 second from the Pulseaudio server. The
default is normally significantly higher. We don't need low latency,
while higher latency helps prevent underflows reduces need for
wakeups.
2012-03-26 03:55:31 +03:00
Uoti Urpala 4fed8ad197 ao_pulse: convert to new AO API 2012-03-26 03:55:31 +03:00
Uoti Urpala ec58e5a384 options: move mixer.h options to struct 2012-03-20 14:51:32 +02:00
wm4 00421e5eec ao_openal: allow setting the OpenAL sub-device
Now "-ao openal:device=<subdevice>" will pass <subdevice> as device to
OpenAL. This allows selecting both the OpenAL backend (OS-level audio
API) and the physical output device.

The available devices can be listed with "-ao openal:device=help".
2012-03-17 21:06:30 +01:00
wm4 c48c0f453b ao_dsound: fix volume controls
The recent changes in mixer.c require the AO to return a volume of
exactly 0 when audio has been muted. Rather than adding just another
special case to mixer.c, fix ao_dsound.c to return previously set
volumes exactly. Because DirectSound volume control is not connected
with the system mixer, which could change the volume without mplayer
knowing, reading the volume back from DirectSound is pointless.

Also, the code tried to calculate log10(0). Clip the volume to 1,
which results in -10000, DirectSound's definition of silence.
2012-03-17 21:06:30 +01:00
wm4 2f9b14916f ao_dsound: don't repeat parts of the audio buffer when playback ends
When layback of a file ends, the audio output doesn't receive new audio
data, but the rest of the data must be played properly. ao_dsound.c
doesn't handle this properly: DirectSound will continue to play the
ringbuffer, even if mplayer doesn't write any data. There's no explicit
way to prevent such a buffer underrun. Try to detect it and stop
playback.
2012-03-17 21:06:30 +01:00
wm4 6de8120822 Merge remote-tracking branch 'origin/master' into my_master
Conflicts:
	command.c
	mp_core.h
	mplayer.c
	screenshot.c
2012-03-16 19:14:44 +01:00
wm4 8dc0743571 Merge remote-tracking branch 'origin/master' into my_master
Conflicts:
	mplayer.c
	screenshot.c
2012-03-05 22:24:57 +01:00
wm4 24be34f1e9 cleanup: Silence compilation warnings on MinGW-w64
Some of the code, especially the dshow and windows codec loader parts,
are extremely hacky and likely full of bugs. The goal is merely getting
rid of warnings that could obscure more important warnings and actual
bugs, instead of fixing actual problems. This reduces the number of
warnings from over 500 to almost the same as when compiling on Linux.

Note that many problems stem from using the ancient wine-derived
windows headers. There are some differences to the "proper" windows
header. Changing the code to compile with the proper headers would be
too much trouble, and it still has to work on Unix.

Some of the changes might actually break compilation on legacy MinGW,
but we don't support that anymore. Always use MinGW-w64, even when
compiling to 32 bit.

Fixes some warnings in the win32 loader code on Linux too.
2012-03-01 00:22:30 +02:00
Uoti Urpala 9ab501443c configure, ao_alsa: drop support for obsolete ALSA versions
Drop compatibility code for ALSA versions prior to 1.0.9. Change the
configure check to use pkg-config only.
2012-02-27 16:46:56 +02:00
wm4 6e41497d5b Merge branch 'softvol' into my_master 2012-01-18 04:21:58 +01:00
wm4 f7c2ecebcc ao_coreaudio: fix partial volume control
If digital pass-through is used, this supported setting the volume (just
mute, actually), but not getting the volume. This will probably lead to a
stuck mute state in the mplayer frontend. Make the code respond to volume
queries even if digital pass-through is used.

Ideally, ao_coreaudio should implement full mute control, but I can't
even test on OSX.
2012-01-18 04:21:46 +01:00
wm4 1d60badc3d ao_pulse: add mute control 2012-01-18 04:21:46 +01:00
wm4 08978c5fb1 ao_alsa: add mute control 2012-01-18 04:21:46 +01:00
wm4 d4cf8cd7a2 ao_alsa: use "Master" mixer channel instead of "PCM" by default
Do this, because the "Master" channel normally provides proper mute
control.

The old default can be forced with: --mixer-channel=PCM
2012-01-18 04:21:46 +01:00
wm4 06b1de2687 mixer, libao: add proper mute control
The mixer frontend code can now make use of a proper system mixer mute
toggle, if the audio output driver supports it.

The consequence is that, if support is available, mplayer will no longer
temporarily set the system volume to 0 if mute is enabled.

Generally, the code now deals with the following combinations of available
AO features:
- software volume control forced by user (--softvol / soft_vol flag)
  => if enabled, never touch the "hardware" controls
- "hardware"/driver volume control available (whether
  AOCONTROL_GET/SET_VOLUME works)
  => if not available, enable volume controls by enabling softvol
- "hardware"/driver mute control (AOCONTROL_GET/SET_MUTE)
  => if not available, emulate by setting volume to 0
- whether the volume+mute controls are kept or not when the AO is closed
  (indicated by ao->no_persistent_volume)
  => if not persistent, restore the volume/mute next time the AO is opened
2012-01-18 04:21:46 +01:00
wm4 56c1ab1c62 libao2: try to identify some audio outputs that have persistent volume
The mplayer frontend (specifically, mixer.c) needs to know this. If the
audio output doesn't remember the volume across reinitialization, the
frontend will restore the volume settings. There is also the assumption
that the volume setting isn't global in this case (i.e. changing it
won't change the volume of other applications or annoy the user
otherwise).

None of these changes have been tested. I'm guessing that ESD and NAS do
per-connection non-persistent volume settings.
2012-01-18 04:21:46 +01:00
wm4 15a318b2a5 ao_coreaudio: signal that volume controls are not persistent
This will make the mplayer frontend restore the volume on its own when
the audio device is reinitialized.
2012-01-18 04:21:45 +01:00
wm4 29effe9593 mixer: restore volume with audio output drivers without persistent volume
Some audio outputs don't provide access to a system-wide mixer control, and
do per-application audio mixing. Further, some of these forget the volume
as soon as the audio device is closed. This can be annoying, because
mplayer will "forget" the volume when playing a new file or when crossing
ordered chapter boundaries. Support restoring the volume on audio
reinitialization if an audio output driver knowingly behaves this way.
(This doesn't change that mplayer never writes any settings into the config
file, including volume settings.)

This commit doesn't yet change any actual output driver to use this code.

Hopefully make some logic in the volume restore code a bit more robust.
2012-01-18 04:21:45 +01:00
wm4 668654098e audio: change default preference order of AO drivers
Now PulseAudio is preferred over ALSA, which in turn is preferred over
OSS. This should give best results on all systems. On systems with
PulseAudio, we will always use it natively, rather than through the
suboptimal ALSA emulation (which the default ALSA output is normally
redirected to when PulseAudio is active; ALSA hardware devices will
not be, but to use those the user must set AO explicitly in any case,
so changing the defaults makes no difference). The fallback from
ao_pulse to ao_alsa causes no noticeable delay on systems without
PulseAudio. On systems with ALSA, we won't attempt to use OSS anymore.

Also, move OpenAL above SDL. OpenAL should generally work better than
SDL.
2012-01-16 22:40:14 +02:00
reimar 9fae75b81c ao_coreaudio: fix crash when using mute with S/PDIF output
RenderCallbackSPDIF might call read_buffer with NULL data. The purpose
is to drain data from the buffer when the output is muted. Add a check
to call av_fifo_drain() in this case.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34241 b3059339-0415-0410-9bf9-f77b7e298cf2

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34242 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-11-25 05:20:23 +02:00
Zongyao Qu 075edf91f1 ao_coreaudio: fix S/PDIF output on OS X 10.7 2011-11-25 05:19:24 +02:00
Uoti Urpala 2a30588258 ao_pcm: fix pointless message due to uninitialize variable
The variable corresponding to the "fast" suboption of ao_pcm was
uninitialized. Fix. The only effect was possibly printing a warning
about the suboption being deprecated even if it wasn't used.
2011-08-11 20:58:05 +03:00
Uoti Urpala 9d25699c58 audio: export audio pts to AO drivers
Currently the pts value is not directly used by any AO. Will be used
by encoding code.
2011-07-31 16:31:07 +03:00
Uoti Urpala c8b3088c18 audio: move ready-for-ao data buffer from decoder to AO
Move the buffer storing audio data ready to be fed to the audio output
driver from the audio decoder object to the AO object. This will help
encoding code deal with end of input, and may also be useful to
improve other general gapless audio behavior (as AOs which do not
accept chunks smaller than a certain size may keep them in the buffer
while the decoder changes).

Less data may be dropped now when changing audio filters or switching
timeline parts.
2011-07-02 09:22:32 +03:00
diego 6283d4d6bb Windows: ao_pcm: add io.h include for MinGW64
On MinGW64 io.h is needed for _get_osfhandle().

patch by Stephen Sheldon, sfsheldo gmail com

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33341 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-06-29 05:28:58 +03:00
Hans-Kristian Arntzen 48e8556298 ao_rsound: add new RSound audio output driver 2011-06-26 06:19:42 +03:00
Uoti Urpala 12843385fe cleanup: ao_pcm: remove useless assignment to ao->buffersize 2011-06-26 05:50:06 +03:00
Uoti Urpala bdcf4ddf35 ao: fix crash after ao init failure (from recent 3a5fd15fa2)
If opening an audio output driver using the old API failed the
"global_ao" variable was not set back to NULL as it should have been.
This caused an assert failure the next time there was an attempt to
open such an AO (either due to fallback to another AO after the
failure or after moving to another file). Fix.
2011-05-16 01:32:26 +03:00
Uoti Urpala 40f6ab5064 ao_pcm, core: use new API in ao_pcm, change timing with it
Change ao_pcm to use the new audio output driver API and clean up some
of the code. Rewrite the logic controlling how playback timing works
when using -ao pcm. Deprecate the "fast" suboption; its only effect
now is to print a warning, but it's still accepted so that specifying
it is not an error.

Before, timing with -ao pcm and video enabled had two possible
modes. In the default mode playback speed was rather arbitrary - not
realtime, but not particularly fast. -ao pcm:fast tried to play back
at maximum video playback speed - mostly succeeding, but not quite
guaranteed to work in all cases. Now the default is to play at
realtime speed. The -benchmark option can now be used to get faster
playback (same as the video-only case). In the audio-only case
playback is always maximum speed.
2011-05-05 21:34:17 +03:00
Uoti Urpala 2fae42d00e ao_null: convert to new API, cleanup/rewrite 2011-05-05 04:45:44 +03:00