diff options
author | Rodeo <[email protected]> | 2012-10-17 22:37:34 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2012-10-17 22:37:34 +0000 |
commit | c4c248b01207c775129bd7dca2a1e9461fe3e4ef (patch) | |
tree | 5341c8abb29e4acdb26f236e1b735cae963dab3f /libhb/encavcodecaudio.c | |
parent | 3d795b4d0bf3be115cbc107502c162f10ede21a9 (diff) |
hb_ff_set_sample_fmt() improvements.
- allow setting a sample_fmt other than AV_SAMPLE_FMT_FLT
- fall back on planar/packed variant of the requested format if available
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5019 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/encavcodecaudio.c')
-rw-r--r-- | libhb/encavcodecaudio.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libhb/encavcodecaudio.c b/libhb/encavcodecaudio.c index fe398ab4f..0fc23faa0 100644 --- a/libhb/encavcodecaudio.c +++ b/libhb/encavcodecaudio.c @@ -89,8 +89,15 @@ static int encavcodecaInit(hb_work_object_t *w, hb_job_t *job) context->compression_level = audio->config.out.compression_level; } - // Try to set format to float; fall back to whatever is supported. - hb_ff_set_sample_fmt(context, codec); + // set the sample_fmt to something practical + if (audio->config.out.codec == HB_ACODEC_FFFLAC) + { + hb_ff_set_sample_fmt(context, codec, AV_SAMPLE_FMT_S16); + } + else + { + hb_ff_set_sample_fmt(context, codec, AV_SAMPLE_FMT_FLT); + } if (hb_avcodec_open(context, codec, &av_opts, 0)) { |