diff options
-rw-r--r-- | libhb/deca52.c | 12 | ||||
-rw-r--r-- | libhb/decavcodec.c | 14 | ||||
-rw-r--r-- | libhb/declpcm.c | 13 |
3 files changed, 28 insertions, 11 deletions
diff --git a/libhb/deca52.c b/libhb/deca52.c index 5f9960a91..0df250fe9 100644 --- a/libhb/deca52.c +++ b/libhb/deca52.c @@ -373,9 +373,15 @@ static hb_buffer_t* Decode(hb_work_object_t *w) } } } - hb_audio_resample_update(pv->resample, AV_SAMPLE_FMT_FLT, - pv->channel_layout, (double)pv->state->slev, - (double)pv->state->clev, pv->nchannels); + if (hb_audio_resample_update(pv->resample, AV_SAMPLE_FMT_FLT, + pv->channel_layout, + (double)pv->state->slev, + (double)pv->state->clev, pv->nchannels)) + { + hb_log("deca52: hb_audio_resample_update() failed"); + hb_buffer_close(&flt); + return NULL; + } out = hb_audio_resample(pv->resample, (void*)flt->data, 1536); hb_buffer_close(&flt); } diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index 3ea41df23..11a04a8b4 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -1464,10 +1464,16 @@ static void decodeAudio(hb_audio_t *audio, hb_work_private_t *pv, uint8_t *data, } else { - hb_audio_resample_update(pv->resample, pv->context->sample_fmt, - pv->context->channel_layout, - HB_MIXLEV_DEFAULT, HB_MIXLEV_DEFAULT, - pv->context->channels); + if (hb_audio_resample_update(pv->resample, + pv->context->sample_fmt, + pv->context->channel_layout, + HB_MIXLEV_DEFAULT, + HB_MIXLEV_DEFAULT, + pv->context->channels)) + { + hb_log("decavcodec: hb_audio_resample_update() failed"); + return; + } out = hb_audio_resample(pv->resample, (void*)frame.data[0], frame.nb_samples); } diff --git a/libhb/declpcm.c b/libhb/declpcm.c index 1511a6abd..a9e7e6e8f 100644 --- a/libhb/declpcm.c +++ b/libhb/declpcm.c @@ -232,6 +232,7 @@ static int declpcmWork( hb_work_object_t * w, hb_buffer_t ** buf_in, static hb_buffer_t *Decode( hb_work_object_t *w ) { hb_work_private_t *pv = w->private_data; + hb_buffer_t *out; if (pv->nsamples == 0) return NULL; @@ -329,10 +330,14 @@ static hb_buffer_t *Decode( hb_work_object_t *w ) } break; } - hb_buffer_t *out; - hb_audio_resample_update(pv->resample, AV_SAMPLE_FMT_FLT, - hdr2layout[pv->nchannels - 1], HB_MIXLEV_DEFAULT, - HB_MIXLEV_DEFAULT, pv->nchannels); + if (hb_audio_resample_update(pv->resample, AV_SAMPLE_FMT_FLT, + hdr2layout[pv->nchannels - 1], + HB_MIXLEV_DEFAULT, HB_MIXLEV_DEFAULT, + pv->nchannels)) + { + hb_log("declpcm: hb_audio_resample_update() failed"); + return NULL; + } out = hb_audio_resample(pv->resample, (void*)pv->data, pv->nsamples); if (out == NULL) { |