summaryrefslogtreecommitdiffstats
path: root/src/pulse/volume.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulse/volume.c')
-rw-r--r--src/pulse/volume.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/pulse/volume.c b/src/pulse/volume.c
index 9191a074..10a44daf 100644
--- a/src/pulse/volume.c
+++ b/src/pulse/volume.c
@@ -424,8 +424,15 @@ static void get_avg_lr(const pa_channel_map *map, const pa_cvolume *v, pa_volume
}
}
- *l = left / n_left;
- *r = right / n_right;
+ if (n_left <= 0)
+ *l = PA_VOLUME_NORM;
+ else
+ *l = left / n_left;
+
+ if (n_right <= 0)
+ *r = PA_VOLUME_NORM;
+ else
+ *r = right / n_right;
}
float pa_cvolume_get_balance(const pa_channel_map *map, const pa_cvolume *v) {