diff options
author | Rodeo <tdskywalker@gmail.com> | 2012-08-10 18:48:42 +0000 |
---|---|---|
committer | Rodeo <tdskywalker@gmail.com> | 2012-08-10 18:48:42 +0000 |
commit | 332c5629f962014c8121b7a982e438386decdcbc (patch) | |
tree | 280ef79a86760da5ea3039cfcc2b1c91a8317321 /libhb/audio_resample.c | |
parent | 8c2ea6d8db7fafaf89273394d85b3f9a06df4d9c (diff) |
hb_audio_resample: when avresample_open() fails, log the error description.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4897 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/audio_resample.c')
-rw-r--r-- | libhb/audio_resample.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libhb/audio_resample.c b/libhb/audio_resample.c index 072351192..45d2fdf42 100644 --- a/libhb/audio_resample.c +++ b/libhb/audio_resample.c @@ -50,6 +50,8 @@ int hb_audio_resample_update(hb_audio_resample_t *resample, return 1; } + int ret, resample_changed; + new_channel_layout = hb_ff_layout_xlat(new_channel_layout, new_channels); resample->resample_needed = @@ -57,7 +59,7 @@ int hb_audio_resample_update(hb_audio_resample_t *resample, resample->out.sample_fmt != new_sample_fmt || resample->out.channel_layout != new_channel_layout); - int resample_changed = + resample_changed = (resample->resample_needed && (resample->in.sample_fmt != new_sample_fmt || resample->in.channel_layout != new_channel_layout || @@ -99,12 +101,15 @@ int hb_audio_resample_update(hb_audio_resample_t *resample, av_opt_set_double(resample->avresample, "surround_mix_level", new_surroundmixlev, 0); - if (avresample_open(resample->avresample) < 0) + if ((ret = avresample_open(resample->avresample))) { - hb_error("hb_audio_resample_update: avresample_open() failed"); + char err_desc[64]; + av_strerror(ret, err_desc, 63); + hb_error("hb_audio_resample_update: avresample_open() failed (%s)", + err_desc); // avresample won't open, start over avresample_free(&resample->avresample); - return 1; + return ret; } resample->in.sample_fmt = new_sample_fmt; |