[PATCH 1/3] cardwidget: Add a port class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2012-07-22 at 15:23 +0200, poljar (Damir Jeli?) wrote:
> diff --git a/src/mainwindow.cc b/src/mainwindow.cc
> index dc84682..b167943 100644
> --- a/src/mainwindow.cc
> +++ b/src/mainwindow.cc
> @@ -290,6 +290,25 @@ void MainWindow::updateCard(const pa_card_info &info) {
>  
>      w->activeProfile = info.active_profile ? info.active_profile->name : "";
>  
> +    w->ports.clear();
> +    if (pa_context_get_server_protocol_version(get_context()) >= 26) {
> +        for (uint32_t i = 0; i < info.n_ports; ++i) {

I don't think you need to check for the protocol version. libpulse will
initialize the card info with sane defaults (in this case, n_ports will
be 0, so the code that accesses the port data will not get executed).

-- 
Tanu



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux