Re: [pulseaudio-discuss] [PATCH 2/3] sink: Add some comments about the rewind handling during stream moves.

2011-09-29 Thread Maarten Bosmans
Warning bikeshed ahead.

2011/9/29 Tanu Kaskinen :
> ---
>  src/pulsecore/sink.c |   58 
> ++
>  1 files changed, 58 insertions(+), 0 deletions(-)
>
> diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
> index a2642b4..53cab32 100644
> --- a/src/pulsecore/sink.c
> +++ b/src/pulsecore/sink.c
> @@ -2403,6 +2403,46 @@ int pa_sink_process_msg(pa_msgobject *o, int code, 
> void *userdata, int64_t offse
>                 pa_usec_t usec = 0;
>                 size_t sink_nbytes, total_nbytes;
>
> +                /* The old sink probably has some audio from this
> +                 * stream in its buffer. We want to "take it back" as
> +                 * much as possible and play it to the new sink. We
> +                 * don't know at this point how much the old sink can
> +                 * rewind. We have to pick something, and that
> +                 * something is the full latency of the old sink here.
> +                 * So we rewind the stream buffer by the sink latency
> +                 * amount, which may be more than what we should
> +                 * rewind. This can result in a chunk of audio being
> +                 * played both to the old sink and the new sink.

I'd say that these comments can be a bit wider. Coding Style says
about 127 chars. That would be a bit much for a comment block IMHO,
but it would be good to conserve some vertical space here.

Oh, and thanks for addressing
http://www.ohloh.net/p/pulseaudio/factoids/10252254

Maarten
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 2/3] sink: Add some comments about the rewind handling during stream moves.

2011-09-30 Thread Tanu Kaskinen
On Fri, 2011-09-30 at 00:36 +0300, Maarten Bosmans wrote:
> Warning bikeshed ahead.
> 
> 2011/9/29 Tanu Kaskinen :
> > ---
> >  src/pulsecore/sink.c |   58 
> > ++
> >  1 files changed, 58 insertions(+), 0 deletions(-)
> >
> > diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
> > index a2642b4..53cab32 100644
> > --- a/src/pulsecore/sink.c
> > +++ b/src/pulsecore/sink.c
> > @@ -2403,6 +2403,46 @@ int pa_sink_process_msg(pa_msgobject *o, int code, 
> > void *userdata, int64_t offse
> > pa_usec_t usec = 0;
> > size_t sink_nbytes, total_nbytes;
> >
> > +/* The old sink probably has some audio from this
> > + * stream in its buffer. We want to "take it back" as
> > + * much as possible and play it to the new sink. We
> > + * don't know at this point how much the old sink can
> > + * rewind. We have to pick something, and that
> > + * something is the full latency of the old sink here.
> > + * So we rewind the stream buffer by the sink latency
> > + * amount, which may be more than what we should
> > + * rewind. This can result in a chunk of audio being
> > + * played both to the old sink and the new sink.
> 
> I'd say that these comments can be a bit wider. Coding Style says
> about 127 chars. That would be a bit much for a comment block IMHO,
> but it would be good to conserve some vertical space here.

I'm not against making the comments wider. What width would you be happy
with? 100? I propose that something like the following is added to the
CodingStyle document so that there won't be any bikeshedding in the
future regarding this issue:

"The recommended maximum line length of 128 is a bit much for comments.
Comments should be wrapped at X characters. If you prefer, comments with
only few lines can also use shorter line length, but in order to
conserve vertical space, very long comments should always be wrapped at
X characters."

The latter sentence is there, because I think it reflects the current
practice, but it would be ok to me if the second sentence would be
dropped, and the recommendation would be to always wrap at X characters.

What do others think? Is 100 the best number? Or 80? Or 89?

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 2/3] sink: Add some comments about the rewind handling during stream moves.

2011-09-30 Thread Arun Raghavan
On Fri, 2011-09-30 at 12:32 +0300, Tanu Kaskinen wrote:
[...]
> I'm not against making the comments wider. What width would you be happy
> with? 100? I propose that something like the following is added to the
> CodingStyle document so that there won't be any bikeshedding in the
> future regarding this issue:
> 
> "The recommended maximum line length of 128 is a bit much for comments.
> Comments should be wrapped at X characters. If you prefer, comments with
> only few lines can also use shorter line length, but in order to
> conserve vertical space, very long comments should always be wrapped at
> X characters."
> 
> The latter sentence is there, because I think it reflects the current
> practice, but it would be ok to me if the second sentence would be
> dropped, and the recommendation would be to always wrap at X characters.
> 
> What do others think? Is 100 the best number? Or 80? Or 89?

I'm fine with 80, tbh.

-- Arun

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 2/3] sink: Add some comments about the rewind handling during stream moves.

2011-09-30 Thread Colin Guthrie
'Twas brillig, and Arun Raghavan at 30/09/11 10:35 did gyre and gimble:
> On Fri, 2011-09-30 at 12:32 +0300, Tanu Kaskinen wrote:
> [...]
>> I'm not against making the comments wider. What width would you be happy
>> with? 100? I propose that something like the following is added to the
>> CodingStyle document so that there won't be any bikeshedding in the
>> future regarding this issue:
>>
>> "The recommended maximum line length of 128 is a bit much for comments.
>> Comments should be wrapped at X characters. If you prefer, comments with
>> only few lines can also use shorter line length, but in order to
>> conserve vertical space, very long comments should always be wrapped at
>> X characters."
>>
>> The latter sentence is there, because I think it reflects the current
>> practice, but it would be ok to me if the second sentence would be
>> dropped, and the recommendation would be to always wrap at X characters.
>>
>> What do others think? Is 100 the best number? Or 80? Or 89?
> 
> I'm fine with 80, tbh.

I'm not particularly bothered but 80 has always sat well with me just
because that's the kinda traditional marker (and the faint line that's
printed in my editor too - although that is obviously configurable).

I don't really mind either way tho'.

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 2/3] sink: Add some comments about the rewind handling during stream moves.

2011-09-30 Thread Tanu Kaskinen
On Fri, 2011-09-30 at 13:31 +0300, Colin Guthrie wrote:
> 'Twas brillig, and Arun Raghavan at 30/09/11 10:35 did gyre and gimble:
> > On Fri, 2011-09-30 at 12:32 +0300, Tanu Kaskinen wrote:
> > [...]
> >> I'm not against making the comments wider. What width would you be happy
> >> with? 100? I propose that something like the following is added to the
> >> CodingStyle document so that there won't be any bikeshedding in the
> >> future regarding this issue:
> >>
> >> "The recommended maximum line length of 128 is a bit much for comments.
> >> Comments should be wrapped at X characters. If you prefer, comments with
> >> only few lines can also use shorter line length, but in order to
> >> conserve vertical space, very long comments should always be wrapped at
> >> X characters."
> >>
> >> The latter sentence is there, because I think it reflects the current
> >> practice, but it would be ok to me if the second sentence would be
> >> dropped, and the recommendation would be to always wrap at X characters.
> >>
> >> What do others think? Is 100 the best number? Or 80? Or 89?
> > 
> > I'm fine with 80, tbh.
> 
> I'm not particularly bothered but 80 has always sat well with me just
> because that's the kinda traditional marker (and the faint line that's
> printed in my editor too - although that is obviously configurable).
> 
> I don't really mind either way tho'.

It seems to me that there's not much enthusiasm for saving vertical
space, so I think I won't need to reformat my patch?

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss