Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marijn Suijten
pulseaudio
Commits
120a70f0
Commit
120a70f0
authored
Oct 11, 2020
by
pali
Committed by
Marijn Suijten
Oct 31, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bluetooth: Remove dead code
parent
941a7f60
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
33 deletions
+5
-33
src/modules/bluetooth/bluez5-util.c
src/modules/bluetooth/bluez5-util.c
+5
-33
No files found.
src/modules/bluetooth/bluez5-util.c
View file @
120a70f0
...
...
@@ -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
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment