[vlc-commits] PulseAudio: bug^Whint user about latency bug
Rémi Denis-Courmont
git at videolan.org
Mon Jan 28 19:50:21 CET 2013
vlc/vlc-2.0 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jan 28 20:49:28 2013 +0200| [2c15f6cf8b8f2677c662720e3d8ed112dd0c593c] | committer: Rémi Denis-Courmont
PulseAudio: bug^Whint user about latency bug
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=2c15f6cf8b8f2677c662720e3d8ed112dd0c593c
---
modules/audio_output/pulse.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index b3d79f2..5df5da7 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -36,6 +36,9 @@
#if !PA_CHECK_VERSION(0,9,22)
# include <vlc_xlib.h>
#endif
+#if !PA_CHECK_VERSION(3,0,0)
+# include <vlc_dialog.h>
+#endif
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
@@ -315,7 +318,25 @@ static void stream_latency_cb(pa_stream *s, void *userdata)
bool sync = false;
if (delta < -AOUT_MAX_PTS_DELAY)
+ {
msg_Warn(aout, "too late by %"PRId64" us", -delta);
+#if !PA_CHECK_VERSION(3,0,0)
+ if (delta < -CLOCK_FREQ)
+ {
+ var_Create (aout->p_libvlc, "pulse-broken", VLC_VAR_BOOL);
+ if (!var_GetBool (aout->p_libvlc, "pulse-broken"))
+ {
+ var_SetBool (aout->p_libvlc, "pulse-broken", true);
+ dialog_Fatal (aout, "Potential PulseAudio version problem",
+ "PulseAudio is streaming with an excessive latency. "
+ "Sound may be lost or quality degraded.\n"
+ "To address that issue, upgrade the PulseAudio daemon "
+ "to version 3.0, or disable the alternate sampling rate "
+ "in its configuration.");
+ }
+ }
+#endif
+ }
else if (delta > +AOUT_MAX_PTS_ADVANCE)
msg_Warn(aout, "too early by %"PRId64" us", delta);
else if (outrate == inrate)
More information about the vlc-commits
mailing list