summaryrefslogtreecommitdiffstats
path: root/libhb/stream.c
diff options
context:
space:
mode:
authorRodeo <[email protected]>2012-06-18 21:11:48 +0000
committerRodeo <[email protected]>2012-06-18 21:11:48 +0000
commitfc3e44b2ba28772fa559d39bd57b7a595a83292f (patch)
tree738449c393dcd8da6edf6881e53353b35e5c47b8 /libhb/stream.c
parent510564b19b5a6d7ac77091cd02ec9c557941399f (diff)
libhb: drop HB_INPUT_CH_LAYOUT_*
AV_CH_LAYOUT_* works for us, and as its usage becomes more widespread in libhb, translating between the two formats gets increasingly tedious. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4754 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/stream.c')
-rw-r--r--libhb/stream.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/libhb/stream.c b/libhb/stream.c
index 9a287dc88..3e4a682e3 100644
--- a/libhb/stream.c
+++ b/libhb/stream.c
@@ -2041,19 +2041,17 @@ static void set_audio_description(
sizeof( audio->config.lang.description ), "%s (%s)",
audio->config.lang.simple, codec_name );
- if( audio->config.in.channel_layout == HB_INPUT_CH_LAYOUT_DOLBY )
+ if (audio->config.in.channel_layout == AV_CH_LAYOUT_STEREO_DOWNMIX)
{
- strcat( audio->config.lang.description, " (Dolby Surround)" );
+ strcat(audio->config.lang.description, " (Dolby Surround)");
}
- else if( audio->config.in.channel_layout )
+ else if (audio->config.in.channel_layout)
{
- 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) );
+ int lfe = !!(audio->config.in.channel_layout & AV_CH_LOW_FREQUENCY);
+ int channels = av_get_channel_layout_nb_channels(audio->config.in.channel_layout);
+ char *desc = audio->config.lang.description +
+ strlen(audio->config.lang.description);
+ sprintf(desc, " (%d.%d ch)", channels - lfe, lfe);
}
}