Commit 120a70f0 authored by pali's avatar pali Committed by Marijn Suijten

bluetooth: Remove dead code

parent 941a7f60
......@@ -110,27 +110,6 @@
" </interface>\n" \
"</node>\n"
// TODO: Delete or move
// static pa_volume_t a2dp_gain_to_volume(uint16_t gain) {
// /* Round to closest by adding half the denominator */
// pa_volume_t volume = (pa_volume_t)((gain * PA_VOLUME_NORM + A2DP_MAX_GAIN / 2) / A2DP_MAX_GAIN);
// if (volume > PA_VOLUME_NORM)
// volume = PA_VOLUME_NORM;
// return volume;
// }
// static uint16_t volume_to_a2dp_gain(pa_volume_t volume) {
// /* Round to closest by adding half the denominator */
// uint64_t gain = (volume * A2DP_MAX_GAIN + PA_VOLUME_NORM / 2) / PA_VOLUME_NORM;
// if (gain > A2DP_MAX_GAIN)
// gain = A2DP_MAX_GAIN;
// return gain;
// }
struct pa_bluetooth_discovery {
PA_REFCNT_DECLARE;
......@@ -444,10 +423,10 @@ static void pa_bluetooth_transport_remote_volume_changed(pa_bluetooth_transport
if (pa_bluetooth_profile_is_a2dp_source(t->profile)) {
t->rx_volume_gain = volume;
hook = /* PA_BLUETOOTH_HOOK_TRANSPORT_SOURCE_VOLUME_CHANGED */PA_BLUETOOTH_HOOK_TRANSPORT_RX_VOLUME_GAIN_CHANGED;
hook = PA_BLUETOOTH_HOOK_TRANSPORT_RX_VOLUME_GAIN_CHANGED;
} else if (pa_bluetooth_profile_is_a2dp_sink(t->profile)) {
t->tx_volume_gain = volume;
hook = /* PA_BLUETOOTH_HOOK_TRANSPORT_SINK_VOLUME_CHANGED */PA_BLUETOOTH_HOOK_TRANSPORT_TX_VOLUME_GAIN_CHANGED;
hook = PA_BLUETOOTH_HOOK_TRANSPORT_TX_VOLUME_GAIN_CHANGED;
} else {
pa_assert_not_reached();
}
......@@ -629,11 +608,6 @@ static void bluez5_transport_set_volume(pa_bluetooth_transport *t, uint16_t gain
pa_assert(pa_bluetooth_profile_is_a2dp(t->profile));
pa_assert(t->device->discovery);
// TODO: Pali already converted this
// gain = volume_to_a2dp_gain(volume);
// /* Propagate rounding and bound checks */
// volume = a2dp_gain_to_volume(gain);
if (pa_bluetooth_profile_is_a2dp_source(t->profile) && t->rx_volume_gain == gain)
return;
else if (pa_bluetooth_profile_is_a2dp_sink(t->profile) && t->tx_volume_gain == gain)
......@@ -822,11 +796,9 @@ static void parse_transport_property(pa_bluetooth_transport *t, DBusMessageIter
uint16_t value;
dbus_message_iter_get_basic(&variant_i, &value);
if (pa_streq(key, "Volume")) {
// TODO: Pali moved this conversion into module-bluez5-device...
// pa_volume_t volume = a2dp_gain_to_volume(value);
pa_bluetooth_transport_remote_volume_changed(t, /* volume */ (pa_volume_t)value);
}
if (pa_streq(key, "Volume"))
pa_bluetooth_transport_remote_volume_changed(t, value);
break;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment