diff options
author | Rodeo <[email protected]> | 2012-08-15 15:15:35 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2012-08-15 15:15:35 +0000 |
commit | 0217b856e5dad739dc75874d9a0360c6b048a719 (patch) | |
tree | 2b9c0a026dde977fe30665957ef99518f38f624d /libhb | |
parent | 939a4a3e6ffefa889ad3ebcf8db6ba93f74c8803 (diff) |
Check the return code of hb_audio_resample_update(). This allows us to log an error when it fails, so we know which decoder actually called the function.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4904 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-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) { |