[pulseaudio-discuss] [PATCH 3/3] devicewidget: Add a latency offset spinbutton
Tanu Kaskinen
tanuk at iki.fi
Thu Jul 26 23:34:14 PDT 2012
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
More information about the pulseaudio-discuss
mailing list