1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-19 21:31:52 +00:00

ao_pulse: remove hacks for ancient PulseAudio versions

This was needed by very old (0.9) versions only. Get rid of it.

Unfortunately, I can't cross-check with the original bug report, since
the bug URL leads to this:

Internal Server Error

TracError: IOError: [Errno 2] No such file or directory: '/home/lennart/svn/trac/pulseaudio/VERSION'
This commit is contained in:
wm4 2014-07-26 22:40:27 +02:00
parent 3c7675ae9a
commit 77d9e4b8a9
3 changed files with 2 additions and 23 deletions

View File

@ -53,7 +53,6 @@ struct priv {
// temporary during control()
struct pa_sink_input_info pi;
bool broken_pause;
int retval;
// for wakeup handling
@ -280,26 +279,12 @@ static int init(struct ao *ao)
struct priv *priv = ao->priv;
char *host = priv->cfg_host && priv->cfg_host[0] ? priv->cfg_host : NULL;
char *sink = priv->cfg_sink && priv->cfg_sink[0] ? priv->cfg_sink : NULL;
const char *version = pa_get_library_version();
pthread_mutex_init(&priv->wakeup_lock, NULL);
pthread_cond_init(&priv->wakeup, NULL);
ao->per_application_mixer = true;
priv->broken_pause = false;
/* not sure which versions are affected, assume 0.9.11* to 0.9.14*
* known bad: 0.9.14, 0.9.13
* known good: 0.9.9, 0.9.10, 0.9.15
* To test: pause, wait ca. 5 seconds, framestep and see if MPlayer
* hangs somewhen. */
if (strncmp(version, "0.9.1", 5) == 0 && version[5] >= '1'
&& version[5] <= '4') {
MP_WARN(ao, "working around probably broken pause functionality,\n"
" see http://www.pulseaudio.org/ticket/440\n");
priv->broken_pause = true;
}
if (!(priv->mainloop = pa_threaded_mainloop_new())) {
MP_ERR(ao, "Failed to allocate main loop\n");
goto fail;
@ -465,12 +450,6 @@ static void pause(struct ao *ao)
// Resume the audio stream by uncorking it on the server
static void resume(struct ao *ao)
{
struct priv *priv = ao->priv;
/* Without this, certain versions will cause an infinite hang because
* pa_stream_writable_size returns 0 always.
* Note that this workaround causes A-V desync after pause. */
if (priv->broken_pause)
reset(ao);
cork(ao, false);
}

View File

@ -720,7 +720,7 @@ check_statement_libs "RSound" $_rsound RSOUND rsound.h 'rsd_init(NULL);' -lrsoun
check_statement_libs "sndio" $_sndio SNDIO sndio.h 'struct sio_par par; sio_initpar(&par); const char *s = SIO_DEVANY' -lsndio
check_pkg_config "PulseAudio" $_pulse PULSE 'libpulse >= 0.9'
check_pkg_config "PulseAudio" $_pulse PULSE 'libpulse >= 1.0'
check_pkg_config "PortAudio" $_portaudio PORTAUDIO 'portaudio-2.0 >= 19'

View File

@ -479,7 +479,7 @@ audio_output_features = [
}, {
'name': '--pulse',
'desc': 'PulseAudio audio output',
'func': check_pkg_config('libpulse', '>= 0.9')
'func': check_pkg_config('libpulse', '>= 1.0')
}, {
'name': '--portaudio',
'desc': 'PortAudio audio output',