Advertisement
Guest User

ponymix volume

a guest
Nov 19th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.70 KB | None | 0 0
  1. diff --git a/pulse.cc b/pulse.cc
  2. index 2d0b94f..0919d43 100644
  3. --- a/pulse.cc
  4. +++ b/pulse.cc
  5. @@ -73,12 +73,11 @@ static void server_info_cb(pa_context* context __attribute__((unused)),
  6.  }
  7.  
  8.  static pa_cvolume* value_to_cvol(long value, pa_cvolume *cvol) {
  9. -  return pa_cvolume_set(cvol, cvol->channels,
  10. -      fmax(static_cast<double>(value + .5) * PA_VOLUME_NORM / 100, 0));
  11. +  return pa_cvolume_set(cvol, cvol->channels, std::max(value * PA_VOLUME_NORM / 100, 0L));
  12.  }
  13.  
  14.  static int volume_as_percent(const pa_cvolume* cvol) {
  15. -  return pa_cvolume_avg(cvol) * 100.0 / PA_VOLUME_NORM;
  16. +  return pa_cvolume_avg(cvol) * 100 / PA_VOLUME_NORM;
  17.  }
  18.  
  19.  static int xstrtol(const char *str, long *out) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement