diff options
author | Rodeo <[email protected]> | 2015-02-15 22:48:46 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2015-02-15 22:48:46 +0000 |
commit | 3adcd92b35be6fb8940c5f249112a263c7ec0ed9 (patch) | |
tree | 49dfe2e1b269be7a0238fa3c5367899da783451a /libhb/decavcodec.c | |
parent | 901d81b2b980c3afa7e14f434cc8ffd092cc750e (diff) |
New audio output options.
Dolby Digital Plus (E-AC-3), Dolby TrueHD and FLAC can now be passed through without re-encoding. They aren't covered by Auto Passthru yet, however.
In addition, encoding to E-AC-3 is now possible.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6908 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/decavcodec.c')
-rw-r--r-- | libhb/decavcodec.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index fef5dd89d..dffb23a84 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -333,16 +333,6 @@ static int decavcodecaInit( hb_work_object_t * w, hb_job_t * job ) { switch (w->audio->config.out.mixdown) { - case HB_AMIXDOWN_MONO: - if (w->codec_param == AV_CODEC_ID_TRUEHD) - { - // libavcodec can't decode TrueHD Mono (bug #356) - // work around it by requesting Stereo and downmixing - pv->context->request_channel_layout = AV_CH_LAYOUT_STEREO; - break; - } - pv->context->request_channel_layout = AV_CH_LAYOUT_MONO; - break; // request 5.1 before downmixing to dpl1/dpl2 case HB_AMIXDOWN_DOLBY: case HB_AMIXDOWN_DOLBYPLII: @@ -357,6 +347,14 @@ static int decavcodecaInit( hb_work_object_t * w, hb_job_t * job ) } } + // libavcodec can't decode TrueHD Mono (bug #356) + // work around it by requesting Stereo and downmixing + if (w->codec_param == AV_CODEC_ID_TRUEHD && + w->audio->config.in.channel_layout == AV_CH_LAYOUT_MONO) + { + pv->context->request_channel_layout = AV_CH_LAYOUT_STEREO; + } + // Set decoder opts... AVDictionary * av_opts = NULL; av_dict_set( &av_opts, "refcounted_frames", "1", 0 ); @@ -711,7 +709,6 @@ static int decavcodecaBSInfo( hb_work_object_t *w, const hb_buffer_t *buf, } if (dec_len > 0 && got_frame) { - info->rate.den = 1; // libavcoded doesn't consistently set frame->sample_rate if (frame->sample_rate != 0) { @@ -722,7 +719,9 @@ static int decavcodecaBSInfo( hb_work_object_t *w, const hb_buffer_t *buf, info->rate.num = context->sample_rate; hb_log("decavcodecaBSInfo: warning: invalid frame sample_rate! Using context sample_rate."); } - info->samples_per_frame = frame->nb_samples; + info->rate.den = 1; + info->samples_per_frame = frame->nb_samples; + info->sample_bit_depth = context->bits_per_raw_sample; int bps = av_get_bits_per_sample(context->codec_id); int channels = av_get_channel_layout_nb_channels(frame->channel_layout); |