Re: Questionable code in sys/dev/sound/pcm/channel.c

From: John-Mark Gurney <gurney_j_at_resnet.uoregon.edu>
Date: Mon, 26 Jul 2004 15:42:20 -0700
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."
Received on Mon Jul 26 2004 - 20:42:22 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:03 UTC