vlc-2.1.0-TomWij-bisected-PA-broken-underflow.patch 700 B

123456789101112131415161718192021222324
  1. index 2debbcd..72e7fcf 100644
  2. --- a/modules/audio_output/pulse.c
  3. +++ b/modules/audio_output/pulse.c
  4. @@ -472,8 +472,17 @@ static void stream_underflow_cb(pa_stream *s, void *userdata)
  5. {
  6. + uint32_t rate = pa_stream_get_sample_spec(s)->rate;
  7. audio_output_t *aout = userdata;
  8. - msg_Dbg(aout, "underflow");
  9. - (void) s;
  10. + msg_Warn(aout, "underflow");
  11. + stream_stop(s, aout);
  12. +
  13. + aout_sys_t *sys = aout->sys;
  14. + sys->first_pts = VLC_TS_INVALID;
  15. +
  16. + pa_operation *op = pa_stream_update_sample_rate(s, rate, NULL, NULL);
  17. + if (unlikely(op == NULL))
  18. + return;
  19. + pa_operation_unref(op);
  20. }
  21. static int stream_wait(pa_stream *stream, pa_threaded_mainloop *mainloop)