pcm_resample: don't resample partial samples

Added assertions which ensure that there are no partial samples in the
source buffer.
This commit is contained in:
Max Kellermann
2008-10-23 20:01:12 +02:00
parent b13d656f81
commit 124f79a2a6
2 changed files with 9 additions and 0 deletions

View File

@@ -22,6 +22,7 @@
#include "log.h"
#include "utils.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
@@ -75,6 +76,9 @@ pcm_resample_16(uint8_t channels,
size_t data_out_size;
int error;
assert((src_size % (sizeof(*src_buffer) * channels)) == 0);
assert((dest_size % (sizeof(*dest_buffer) * channels)) == 0);
if (convalgo < 0)
convalgo = pcm_resample_get_converter();