Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jul 2004 15:42:20 -0700
From:      John-Mark Gurney <gurney_j@resnet.uoregon.edu>
To:        "Conrad J. Sabatier" <conrads@cox.net>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Questionable code in sys/dev/sound/pcm/channel.c
Message-ID:  <20040726224220.GM991@funkthat.com>
In-Reply-To: <XFMail.20040726163529.conrads@cox.net>
References:  <XFMail.20040726163529.conrads@cox.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Conrad J. Sabatier wrote this message on Mon, Jul 26, 2004 at 16:35 -0500:
>                 if (timeout < 1)
>                     timeout = 1;
>                 timeout = 1;
> 
> Why the formulaic calculation of timeout, if it's simply going to be
> unconditionally set to 1 immediately afterwards anyway?  What's going on
> here?

Well, if you look at the annotations, that absolute set of timeout was
added in rev 1.65 by cg with the comment:
tweaks to reduce latency/pauses in output

> Also, at the end of the function:
> 
>     if (count <= 0) {
>         c->flags |= CHN_F_DEAD;
>         printf("%s: play interrupt timeout, channel dead\n", c->name);
>     }
> 
>     return ret;
> }

that was changed in rev1.52 (by cg also), and previously was just a check
for count == 0..

So, I'd recommend a message off to cg and ask why he made this changes...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040726224220.GM991>