]> git.sesse.net Git - vlc/commitdiff
PulseAudio: remove broken logic
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 2 Sep 2013 20:01:17 +0000 (23:01 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 2 Sep 2013 20:08:54 +0000 (23:08 +0300)
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.

modules/audio_output/pulse.c

index 531c193a72f69cf282dfd1e49f3fc43970116bc1..59a4840e460c48b82ac232d600a54f8fe724b729 100644 (file)
@@ -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);