<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div> </div>
<div>On Fri, Apr 17, 2015, at 21:03, Rémi Denis-Courmont wrote:<br></div>
<blockquote type="cite"><div style="font-size: 12pt; font-family: Calibri,sans-serif;"><div>It was already pointed out a few weeks ago that this approach is wrong, because underflow can occur during normal playback.<br></div>
</div>
</blockquote><div> </div>
<div>OK.<br></div>
<div>I proposed a new patch that stop the stream after a flush.<br></div>
<div> </div>
<blockquote type="cite"><div style="font-size: 12pt; font-family: Calibri,sans-serif;"><div> </div>
<div>--<br></div>
<div>Rémi Denis-Courmont<br></div>
<div>Sent from my NVIDIA Tegra-powered device<br></div>
<div> </div>
<div>----- Reply message -----<br></div>
<div>De : "Thomas Guillem" <thomas@gllm.fr><br></div>
<div>Pour : <vlc-devel@videolan.org><br></div>
<div>Objet : [vlc-devel] [RFC PATCH] PulseAudio: fix audio drop after an  underflow<br></div>
<div>Date : ven., avr. 17, 2015 16:29<br></div>
</div>
<div> </div>
<pre style="word-wrap: break-word; white-space: pre-wrap;">This fixes audio drop when the track has a positive delay.
---
Hi,

I'm trying to fix an issue with Pulse Audio when changing the audio track
synchronization. Indeed, you can loose audio when you seek after selecting a
positive delay. I think it happens because we wait too long between the last
pa_stream_cork/pa_stream_flush and the first pa_stream_write.

I'm not sure if this is the best way to fix this issue.

An other way to fix this issue is to pause pulse after a flush and start it
again before the next write.

How to reproduce:
$ ./vlc --audio-desync=2500 <video>
Audio will start playing after a delay of 2500ms, but if you seek, you'll loose
audio.

 modules/audio_output/pulse.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index 5947ceb..1284097 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -351,9 +351,13 @@ static void stream_suspended_cb(pa_stream *s, void *userdata)
 static void stream_underflow_cb(pa_stream *s, void *userdata)
 {
     audio_output_t *aout = userdata;
+    aout_sys_t *sys = aout->sys;
 
     msg_Dbg(aout, "underflow");
-    (void) s;
+
+    sys->first_pts = VLC_TS_INVALID;
+    pa_stream_set_latency_update_callback(s, NULL, NULL);
+    stream_stop(s, aout);
 }
 
 static int stream_wait(pa_stream *stream, pa_threaded_mainloop *mainloop)
-- 
2.1.3

_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
<a defang_rel="noreferrer" href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></pre><div><u>_______________________________________________</u><br></div>
<div>vlc-devel mailing list<br></div>
<div>To unsubscribe or modify your subscription options:<br></div>
<div><a defang_rel="noreferrer" href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div>
</blockquote><div> </div>
</body>
</html>