[vlc-commits] PulseAudio: remove broken logic

Rémi Denis-Courmont git at videolan.org
Mon Sep 2 22:09:44 CEST 2013


vlc/vlc-2.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Sep  2 23:01:17 2013 +0300| [22bf3ed2c973b40355348a490c8e89bb4ab555b6] | committer: Rémi Denis-Courmont

PulseAudio: remove broken logic

sys->first_pts is the time the stream started originally, but was
mistaken as the time of the stream was paused.

Now, it is assumed that pausing and resuming take approximately the
same time. This is usually true, and if it is not, there is no way for
either VLC or PulseAudio to know (since ALSA does not expose
pause/resume latency informations for the underlying devices).

In practice, this makes no real difference other than removing a bogus
warning about being late when resuming from pause.

(cherry picked from commit 5e2cb4628173e5c42b9918644b1ae7f91f2e062e)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=22bf3ed2c973b40355348a490c8e89bb4ab555b6
---

 modules/audio_output/pulse.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index 531c193..59a4840 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -570,10 +570,8 @@ static void Pause(audio_output_t *aout, bool paused, mtime_t date)
         msg_Dbg(aout, "resuming after %"PRId64" us", date);
         sys->paused = VLC_TS_INVALID;
 
-        if (sys->first_pts != VLC_TS_INVALID) {
-            sys->first_pts += date;
-            stream_start(s, aout);
-        }
+        if (likely(sys->first_pts != VLC_TS_INVALID))
+            stream_start_now(s, aout);
     }
 
     pa_threaded_mainloop_unlock(sys->mainloop);



More information about the vlc-commits mailing list