mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
spa-resample: handle init errors
This commit is contained in:
parent
ce9a912f1a
commit
11bc60a53d
1 changed files with 7 additions and 2 deletions
|
|
@ -33,6 +33,7 @@
|
|||
#include <spa/support/log-impl.h>
|
||||
#include <spa/debug/mem.h>
|
||||
#include <spa/utils/string.h>
|
||||
#include <spa/utils/result.h>
|
||||
|
||||
#include <sndfile.h>
|
||||
|
||||
|
|
@ -190,7 +191,7 @@ static int do_conversion(struct data *d)
|
|||
const void *src[channels];
|
||||
void *dst[channels];
|
||||
uint32_t i;
|
||||
int j, k, queued;
|
||||
int res, j, k, queued;
|
||||
bool flushing = false;
|
||||
|
||||
spa_zero(r);
|
||||
|
|
@ -200,7 +201,11 @@ static int do_conversion(struct data *d)
|
|||
r.i_rate = d->iinfo.samplerate;
|
||||
r.o_rate = d->oinfo.samplerate;
|
||||
r.quality = d->quality < 0 ? DEFAULT_QUALITY : d->quality;
|
||||
resample_native_init(&r);
|
||||
if ((res = resample_native_init(&r)) < 0) {
|
||||
fprintf(stderr, "can't init converter: %s\n", spa_strerror(res));
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
for (j = 0; j < channels; j++)
|
||||
src[j] = &in[MAX_SAMPLES * j];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue