[PATCH 3/3] devicewidget: Add a latency offset spinbutton

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

 



On Thu, 2012-07-26 at 15:42 +0200, poljar (Damir Jeli?) wrote:
> +static void updatePorts(DeviceWidget *w, std::map<Glib::ustring, PortInfo> &ports) {
> +    std::map<Glib::ustring, PortInfo>::iterator it;
> +    PortInfo *activePort;
> +
> +    it = ports.find(w->activePort);
> +
> +    if (it != ports.end()) {
> +        activePort = &(it->second);
> +        w->setLatencyOffset(activePort->latency_offset);

It looks odd to me to take a pointer only to immediately dereference it.
I changed activePort type to PortInfo reference (and moved the variable
declaration inside the if block).

> @@ -362,6 +406,13 @@ bool MainWindow::updateSink(const pa_sink_info &info) {
>  
>      w->activePort = info.active_port ? info.active_port->name : "";
>  
> +    if (info.card) {

I removed this check. info.card is the card index, so zero is a valid
value.

Thanks for the patches! I've pushed them now.

-- 
Tanu



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

  Powered by Linux