Ticket #641: pa-bluetooth-channels.patch

File pa-bluetooth-channels.patch, 1.5 KB (added by samr7, 22 months ago)

Potential fix

  • src/modules/bluetooth/module-bluetooth-device.c

    old new  
    511511 
    512512    pa_assert((unsigned) i < PA_ELEMENTSOF(freq_table)); 
    513513 
     514    if ((cap->channel_mode & BT_A2DP_CHANNEL_MODE_MONO) && 
     515        (u->sample_spec.channels <= 1)) 
     516        u->sample_spec.channels = 1; 
     517    else 
     518        u->sample_spec.channels = 2; 
     519     
    514520    if (cap->capability.configured) 
    515521        return 0; 
    516522 
    517523    if (u->sample_spec.channels <= 1) { 
    518         if (cap->channel_mode & BT_A2DP_CHANNEL_MODE_MONO) { 
     524        if (cap->channel_mode & BT_A2DP_CHANNEL_MODE_MONO) 
    519525            cap->channel_mode = BT_A2DP_CHANNEL_MODE_MONO; 
    520             u->sample_spec.channels = 1; 
    521         } else 
    522             u->sample_spec.channels = 2; 
    523526    } 
    524527 
    525528    if (u->sample_spec.channels >= 2) { 
    526         u->sample_spec.channels = 2; 
    527  
    528529        if (cap->channel_mode & BT_A2DP_CHANNEL_MODE_JOINT_STEREO) 
    529530            cap->channel_mode = BT_A2DP_CHANNEL_MODE_JOINT_STEREO; 
    530531        else if (cap->channel_mode & BT_A2DP_CHANNEL_MODE_STEREO) 
     
    533534            cap->channel_mode = BT_A2DP_CHANNEL_MODE_DUAL_CHANNEL; 
    534535        else if (cap->channel_mode & BT_A2DP_CHANNEL_MODE_MONO) { 
    535536            cap->channel_mode = BT_A2DP_CHANNEL_MODE_MONO; 
    536             u->sample_spec.channels = 1; 
    537537        } else { 
    538538            pa_log("No supported channel modes"); 
    539539            return -1;