mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05: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/support/log-impl.h>
|
||||||
#include <spa/debug/mem.h>
|
#include <spa/debug/mem.h>
|
||||||
#include <spa/utils/string.h>
|
#include <spa/utils/string.h>
|
||||||
|
#include <spa/utils/result.h>
|
||||||
|
|
||||||
#include <sndfile.h>
|
#include <sndfile.h>
|
||||||
|
|
||||||
|
|
@ -190,7 +191,7 @@ static int do_conversion(struct data *d)
|
||||||
const void *src[channels];
|
const void *src[channels];
|
||||||
void *dst[channels];
|
void *dst[channels];
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
int j, k, queued;
|
int res, j, k, queued;
|
||||||
bool flushing = false;
|
bool flushing = false;
|
||||||
|
|
||||||
spa_zero(r);
|
spa_zero(r);
|
||||||
|
|
@ -200,7 +201,11 @@ static int do_conversion(struct data *d)
|
||||||
r.i_rate = d->iinfo.samplerate;
|
r.i_rate = d->iinfo.samplerate;
|
||||||
r.o_rate = d->oinfo.samplerate;
|
r.o_rate = d->oinfo.samplerate;
|
||||||
r.quality = d->quality < 0 ? DEFAULT_QUALITY : d->quality;
|
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++)
|
for (j = 0; j < channels; j++)
|
||||||
src[j] = &in[MAX_SAMPLES * j];
|
src[j] = &in[MAX_SAMPLES * j];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue