From: Takashi Iwai <tiwai@suse.de>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: Jaroslav Kysela <perex@suse.cz>,
ALSA development <alsa-devel@alsa-project.org>
Subject: Re: Re: [alsa-cvslog] CVS: alsa-kernel/core/oss pcm_oss.c,1.87,1.88
Date: Fri, 27 May 2005 11:32:55 +0200 [thread overview]
Message-ID: <s5hk6llxbco.wl@alsa2.suse.de> (raw)
In-Reply-To: <Pine.HPX.4.33n.0505271112380.8310-100000@studcom.urz.uni-halle.de>
At Fri, 27 May 2005 11:23:17 +0200 (METDST),
Clemens Ladisch wrote:
>
> > This reverts the last patch which wrongly mixes bytes and frames.
> > The real culprit might be the 32-bit overflow, so the return expression uses
> > 64-bit values now in snd_pcm_oss_bytes().
> >
> > static long snd_pcm_oss_bytes(snd_pcm_substream_t *substream, long frames)
> > {
> > - long bytes = 0;
> > snd_pcm_runtime_t *runtime = substream->runtime;
> > snd_pcm_uframes_t buffer_size = snd_pcm_lib_buffer_bytes(substream);
> > - bytes = frames_to_bytes(runtime, frames);
> > + frames = frames_to_bytes(runtime, frames);
> > if (buffer_size == runtime->oss.buffer_bytes)
> > - return bytes;
> > - return (runtime->oss.buffer_bytes * frames) / buffer_size;
> > + return frames;
> > + return (long)(((int64_t)runtime->oss.buffer_bytes * (int64_t)frames) / (int64_t)buffer_size);
> > }
>
> This still uses a misleading type for buffer_size, and uses 'frames'
> for a value not measure in frames. I think I'd better rename these.
> Any objections?
I second.
Takashi
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
next prev parent reply other threads:[~2005-05-27 9:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1DbLgK-0000QR-5z@sc8-pr-cvs1.sourceforge.net>
2005-05-27 8:40 ` [alsa-cvslog] CVS: alsa-kernel/core/oss pcm_oss.c,1.87,1.88 Jaroslav Kysela
2005-05-27 9:23 ` Clemens Ladisch
2005-05-27 9:32 ` Takashi Iwai [this message]
2005-05-27 10:12 ` Jaroslav Kysela
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hk6llxbco.wl@alsa2.suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=clemens@ladisch.de \
--cc=perex@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.