jack: added constant "frame_size"

Don't hard-code a frame size of "4" (16 bit stereo), calculate the
sample size from sizeof(*buffer), and create the constant
"frame_size".
This commit is contained in:
Max Kellermann 2008-10-24 15:47:52 +02:00
parent 9d6651d8b2
commit 91ad576aad

View File

@ -389,8 +389,9 @@ static int jack_playAudio(void *data,
size_t space;
size_t i;
const short *buffer = (const short *) buff;
static const size_t frame_size = sizeof(*buffer) * 2;
jack_default_audio_sample_t sample;
size_t samples = size/4;
size_t samples = size / frame_size;
/*DEBUG("jack_playAudio: (pid=%d)!\n", getpid());*/