pw-cat: read and write raw formats correctly

We need to transform the number of bytes into frames.
This commit is contained in:
Wim Taymans 2022-06-29 17:29:16 +02:00
parent 0b62cea4f9
commit d1ee783322

View file

@ -196,7 +196,7 @@ static int sf_playback_fill_x8(struct data *d, void *dest, unsigned int n_frames
sf_count_t rn;
rn = sf_read_raw(d->file, dest, n_frames * d->stride);
return (int)rn;
return (int)rn / d->stride;
}
static int sf_playback_fill_s16(struct data *d, void *dest, unsigned int n_frames)
@ -278,7 +278,7 @@ static int sf_record_fill_x8(struct data *d, void *src, unsigned int n_frames)
sf_count_t rn;
rn = sf_write_raw(d->file, src, n_frames * d->stride);
return (int)rn;
return (int)rn / d->stride;
}
static int sf_record_fill_s16(struct data *d, void *src, unsigned int n_frames)