summaryrefslogtreecommitdiffstats
path: root/libhb/stream.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-04-02 15:10:48 +0000
committerjstebbins <[email protected]>2010-04-02 15:10:48 +0000
commiteb4ffde8a29cf9b77a84440fa6c404e94eb9b6a6 (patch)
treeea5149118b167b07f4a33f4f0cf9f1a8ea7ee61f /libhb/stream.c
parent13eb2d6d5e7ad894d0dfe808dc3cb26a062d48b7 (diff)
downmix support for ffmpeg audio sources
now we can eat our own dogfood. i.e. aac 6ch discrete input now works, along with any other multi-channel audio ffmpeg can toss at us. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3182 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/stream.c')
-rw-r--r--libhb/stream.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/libhb/stream.c b/libhb/stream.c
index 9d0ce8071..f75400f45 100644
--- a/libhb/stream.c
+++ b/libhb/stream.c
@@ -1435,6 +1435,18 @@ static void set_audio_description( hb_audio_t *audio, iso639_lang_t *lang )
sizeof( audio->config.lang.description ), "%s (%s)",
strlen(lang->native_name) ? lang->native_name : lang->eng_name,
codec_name );
+
+ if (audio->config.in.codec == HB_ACODEC_FFMPEG)
+ {
+ int layout = audio->config.in.channel_layout;
+ char *desc = audio->config.lang.description +
+ strlen( audio->config.lang.description );
+ sprintf( desc, " (%d.%d ch)",
+ HB_INPUT_CH_LAYOUT_GET_DISCRETE_FRONT_COUNT(layout) +
+ HB_INPUT_CH_LAYOUT_GET_DISCRETE_REAR_COUNT(layout),
+ HB_INPUT_CH_LAYOUT_GET_DISCRETE_LFE_COUNT(layout) );
+ }
+
snprintf( audio->config.lang.simple, sizeof( audio->config.lang.simple ), "%s",
strlen(lang->native_name) ? lang->native_name : lang->eng_name );
snprintf( audio->config.lang.iso639_2, sizeof( audio->config.lang.iso639_2 ),
@@ -2777,18 +2789,6 @@ static void add_ffmpeg_audio( hb_title_t *title, hb_stream_t *stream, int id )
// paramters here.
if ( codec->bit_rate || codec->sample_rate )
{
- static const int chan2layout[] = {
- HB_INPUT_CH_LAYOUT_MONO, // We should allow no audio really.
- HB_INPUT_CH_LAYOUT_MONO,
- HB_INPUT_CH_LAYOUT_STEREO,
- HB_INPUT_CH_LAYOUT_2F1R,
- HB_INPUT_CH_LAYOUT_2F2R,
- HB_INPUT_CH_LAYOUT_3F2R,
- HB_INPUT_CH_LAYOUT_4F2R,
- HB_INPUT_CH_LAYOUT_STEREO,
- HB_INPUT_CH_LAYOUT_STEREO,
- };
-
hb_audio_t *audio = calloc( 1, sizeof(*audio) );;
audio->id = id;
@@ -2807,7 +2807,8 @@ static void add_ffmpeg_audio( hb_title_t *title, hb_stream_t *stream, int id )
audio->config.in.bitrate = codec->bit_rate? codec->bit_rate : 1;
audio->config.in.samplerate = codec->sample_rate;
- audio->config.in.channel_layout = chan2layout[codec->channels & 7];
+ audio->config.in.channel_layout =
+ hb_ff_layout_xlat(codec->channel_layout, codec->channels);
}
set_audio_description( audio, lang_for_code2( st->language ) );