Commit 0ed2f2b3 authored by pali's avatar pali

fixup! bluetooth: Add A2DP aptX and aptX HD codecs support

parent facef169
......@@ -107,10 +107,11 @@ static int cmp_endpoints_common(const a2dp_aptx_t *capabilities1, const a2dp_apt
} else if (freq2) {
return 1;
} else {
/* Both endpoints support only frequencies lower than requested sampling rate, therefore prefer endpoint with higher supported frequency */
for (i = PA_ELEMENTSOF(freq_table)-1; i >= 0; i--) {
if (capabilities1->frequency & freq_table[i].cap)
if (!freq1 && (capabilities1->frequency & freq_table[i].cap))
freq1 = freq_table[i].rate;
if (capabilities2->frequency & freq_table[i].cap)
if (!freq2 && (capabilities2->frequency & freq_table[i].cap))
freq2 = freq_table[i].rate;
if (freq1 && freq2)
break;
......@@ -119,7 +120,7 @@ static int cmp_endpoints_common(const a2dp_aptx_t *capabilities1, const a2dp_apt
if (freq1 > freq2)
return -1;
if (freq2 < freq1)
if (freq1 < freq2)
return 1;
}
......
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