Commit c5dcc5dd authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

PulseAudio: require version 1.0 or later

The code no longer compiles with older versions anyway.
parent 05132466
...@@ -3509,23 +3509,11 @@ AC_ARG_ENABLE(pulse, ...@@ -3509,23 +3509,11 @@ AC_ARG_ENABLE(pulse,
[use the PulseAudio client library (default auto)])]) [use the PulseAudio client library (default auto)])])
have_pulse="no" have_pulse="no"
AS_IF([test "${enable_pulse}" != "no"], [ AS_IF([test "${enable_pulse}" != "no"], [
PKG_CHECK_MODULES([PULSE], [libpulse >= 0.9.22], [ PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
have_pulse="yes" have_pulse="yes"
], [ ], [
PKG_CHECK_MODULES([PULSE], [libpulse >= 0.9.16], [ AS_IF([test "x${enable_pulse}" != "x"], [
AS_IF([test "${no_x}" != "yes"], [ AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
have_pulse="yes"
PULSE_LIBS="$PULSE_LIBS ${X_LIBS} ${X_PRE_LIBS} -lX11"
], [
AS_IF([test "${enable_pulse}" = "yes"], [
AC_MSG_ERROR([Xlib is required with PulseAudio pre-0.9.22 versions
(see http://www.pulseaudio.org/ticket/799 for further reference).])
])
])
], [
AS_IF([test "x${enable_pulse}" != "x"], [
AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 0.9.22 or later required.])
])
]) ])
]) ])
]) ])
......
...@@ -33,9 +33,6 @@ ...@@ -33,9 +33,6 @@
#include <pulse/pulseaudio.h> #include <pulse/pulseaudio.h>
#include "audio_output/vlcpulse.h" #include "audio_output/vlcpulse.h"
#if !PA_CHECK_VERSION(0,9,22)
# include <vlc_xlib.h>
#endif
static int Open ( vlc_object_t * ); static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * ); static void Close ( vlc_object_t * );
...@@ -340,13 +337,11 @@ static void stream_event_cb(pa_stream *s, const char *name, pa_proplist *pl, ...@@ -340,13 +337,11 @@ static void stream_event_cb(pa_stream *s, const char *name, pa_proplist *pl,
if (!strcmp(name, PA_STREAM_EVENT_REQUEST_UNCORK)) if (!strcmp(name, PA_STREAM_EVENT_REQUEST_UNCORK))
aout_PolicyReport(aout, false); aout_PolicyReport(aout, false);
else else
#if PA_CHECK_VERSION(1,0,0)
/* FIXME: expose aout_Restart() directly */ /* FIXME: expose aout_Restart() directly */
if (!strcmp(name, PA_STREAM_EVENT_FORMAT_LOST)) { if (!strcmp(name, PA_STREAM_EVENT_FORMAT_LOST)) {
msg_Dbg (aout, "format lost"); msg_Dbg (aout, "format lost");
aout_RestartRequest (aout, AOUT_RESTART_OUTPUT); aout_RestartRequest (aout, AOUT_RESTART_OUTPUT);
} else } else
#endif
msg_Warn (aout, "unhandled stream event \"%s\"", name); msg_Warn (aout, "unhandled stream event \"%s\"", name);
(void) s; (void) s;
(void) pl; (void) pl;
...@@ -756,9 +751,7 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt) ...@@ -756,9 +751,7 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
/* Sample format specification */ /* Sample format specification */
struct pa_sample_spec ss; struct pa_sample_spec ss;
#if PA_CHECK_VERSION(1,0,0)
pa_encoding_t encoding = PA_ENCODING_INVALID; pa_encoding_t encoding = PA_ENCODING_INVALID;
#endif
switch (fmt->i_format) switch (fmt->i_format)
{ {
...@@ -776,7 +769,6 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt) ...@@ -776,7 +769,6 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
case VLC_CODEC_U8: case VLC_CODEC_U8:
ss.format = PA_SAMPLE_U8; ss.format = PA_SAMPLE_U8;
break; break;
#if PA_CHECK_VERSION(1,0,0)
case VLC_CODEC_A52: case VLC_CODEC_A52:
fmt->i_format = VLC_CODEC_SPDIFL; fmt->i_format = VLC_CODEC_SPDIFL;
encoding = PA_ENCODING_AC3_IEC61937; encoding = PA_ENCODING_AC3_IEC61937;
...@@ -797,7 +789,6 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt) ...@@ -797,7 +789,6 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
encoding = PA_ENCODING_DTS_IEC61937; encoding = PA_ENCODING_DTS_IEC61937;
ss.format = HAVE_FPU ? PA_SAMPLE_FLOAT32NE : PA_SAMPLE_S16NE; ss.format = HAVE_FPU ? PA_SAMPLE_FLOAT32NE : PA_SAMPLE_S16NE;
break; break;
#endif
default: default:
if (HAVE_FPU) if (HAVE_FPU)
{ {
...@@ -889,7 +880,6 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt) ...@@ -889,7 +880,6 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
pa_cvolume_init(&sys->cvolume); pa_cvolume_init(&sys->cvolume);
sys->first_pts = VLC_TS_INVALID; sys->first_pts = VLC_TS_INVALID;
#if PA_CHECK_VERSION(1,0,0)
pa_format_info *formatv[2]; pa_format_info *formatv[2];
unsigned formatc = 0; unsigned formatc = 0;
...@@ -919,24 +909,20 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt) ...@@ -919,24 +909,20 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
formatc++; formatc++;
/* Create a playback stream */ /* Create a playback stream */
pa_stream *s;
pa_proplist *props = pa_proplist_new(); pa_proplist *props = pa_proplist_new();
if (likely(props != NULL)) if (likely(props != NULL))
/* TODO: set other stream properties */ /* TODO: set other stream properties */
pa_proplist_sets (props, PA_PROP_MEDIA_ROLE, "video"); pa_proplist_sets (props, PA_PROP_MEDIA_ROLE, "video");
pa_threaded_mainloop_lock(sys->mainloop); pa_threaded_mainloop_lock(sys->mainloop);
s = pa_stream_new_extended(sys->context, "audio stream", formatv, formatc, pa_stream *s = pa_stream_new_extended(sys->context, "audio stream",
props); formatv, formatc, props);
if (likely(props != NULL)) if (likely(props != NULL))
pa_proplist_free(props); pa_proplist_free(props);
for (unsigned i = 0; i < formatc; i++) for (unsigned i = 0; i < formatc; i++)
pa_format_info_free(formatv[i]); pa_format_info_free(formatv[i]);
#else
pa_threaded_mainloop_lock(sys->mainloop);
pa_stream *s = pa_stream_new(sys->context, "audio stream", &ss, &map);
#endif
if (s == NULL) { if (s == NULL) {
pa_threaded_mainloop_unlock(sys->mainloop); pa_threaded_mainloop_unlock(sys->mainloop);
vlc_pa_error(aout, "stream creation failure", sys->context); vlc_pa_error(aout, "stream creation failure", sys->context);
...@@ -966,7 +952,6 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt) ...@@ -966,7 +952,6 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
sys->sink_force = NULL; sys->sink_force = NULL;
const struct pa_sample_spec *spec = pa_stream_get_sample_spec(s); const struct pa_sample_spec *spec = pa_stream_get_sample_spec(s);
#if PA_CHECK_VERSION(1,0,0)
if (encoding != PA_ENCODING_INVALID) { if (encoding != PA_ENCODING_INVALID) {
const pa_format_info *info = pa_stream_get_format_info(s); const pa_format_info *info = pa_stream_get_format_info(s);
...@@ -979,7 +964,6 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt) ...@@ -979,7 +964,6 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
spec = NULL; spec = NULL;
} }
} }
#endif
if (spec != NULL) if (spec != NULL)
fmt->i_rate = spec->rate; fmt->i_rate = spec->rate;
...@@ -1031,10 +1015,6 @@ static int Open(vlc_object_t *obj) ...@@ -1031,10 +1015,6 @@ static int Open(vlc_object_t *obj)
aout_sys_t *sys = malloc(sizeof (*sys)); aout_sys_t *sys = malloc(sizeof (*sys));
pa_operation *op; pa_operation *op;
#if !PA_CHECK_VERSION(0,9,22)
if (!vlc_xlib_init(obj))
return VLC_EGENERIC;
#endif
if (unlikely(sys == NULL)) if (unlikely(sys == NULL))
return VLC_ENOMEM; return VLC_ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment