diff options
author | Rodeo <[email protected]> | 2011-09-19 15:55:26 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2011-09-19 15:55:26 +0000 |
commit | 243f77efd0bede0ea44f63e309b8fcb3b29b5cbc (patch) | |
tree | 6ebcdef6bdb72f240adf1fcf619b6407eb101293 | |
parent | 574730f7b43a60478b22087947487d083b57be71 (diff) |
hb_ff_layout_xlat: minor cleanup.
Slightly more meaningful log messages.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4233 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | libhb/hb.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/libhb/hb.c b/libhb/hb.c index 8ca3918ad..697c68c7a 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -196,16 +196,17 @@ hb_sws_get_context(int srcW, int srcH, enum PixelFormat srcFormat, return ctx; } -int hb_ff_layout_xlat(int64_t ff_channel_layout, int channels) +int hb_ff_layout_xlat( int64_t ff_channel_layout, int channels ) { int hb_layout; - switch (ff_channel_layout) + switch( ff_channel_layout ) { case AV_CH_LAYOUT_MONO: hb_layout = HB_INPUT_CH_LAYOUT_MONO; break; case AV_CH_LAYOUT_STEREO: + case AV_CH_LAYOUT_STEREO_DOWNMIX: hb_layout = HB_INPUT_CH_LAYOUT_STEREO; break; case AV_CH_LAYOUT_SURROUND: @@ -215,20 +216,14 @@ int hb_ff_layout_xlat(int64_t ff_channel_layout, int channels) hb_layout = HB_INPUT_CH_LAYOUT_3F1R; break; case AV_CH_LAYOUT_2_2: - hb_layout = HB_INPUT_CH_LAYOUT_2F2R; - break; case AV_CH_LAYOUT_QUAD: hb_layout = HB_INPUT_CH_LAYOUT_2F2R; break; case AV_CH_LAYOUT_5POINT0: - hb_layout = HB_INPUT_CH_LAYOUT_3F2R; - break; - case AV_CH_LAYOUT_5POINT1: - hb_layout = HB_INPUT_CH_LAYOUT_3F2R|HB_INPUT_CH_LAYOUT_HAS_LFE; - break; case AV_CH_LAYOUT_5POINT0_BACK: hb_layout = HB_INPUT_CH_LAYOUT_3F2R; break; + case AV_CH_LAYOUT_5POINT1: case AV_CH_LAYOUT_5POINT1_BACK: hb_layout = HB_INPUT_CH_LAYOUT_3F2R|HB_INPUT_CH_LAYOUT_HAS_LFE; break; @@ -238,9 +233,6 @@ int hb_ff_layout_xlat(int64_t ff_channel_layout, int channels) case AV_CH_LAYOUT_7POINT1: hb_layout = HB_INPUT_CH_LAYOUT_3F4R|HB_INPUT_CH_LAYOUT_HAS_LFE; break; - case AV_CH_LAYOUT_STEREO_DOWNMIX: - hb_layout = HB_INPUT_CH_LAYOUT_STEREO; - break; default: hb_layout = HB_INPUT_CH_LAYOUT_STEREO; break; @@ -250,12 +242,19 @@ int hb_ff_layout_xlat(int64_t ff_channel_layout, int channels) // about this. So we will make a best guess based on the number // of channels. int chans = HB_INPUT_CH_LAYOUT_GET_DISCRETE_COUNT( hb_layout ); - if ( chans == channels ) + if( ff_channel_layout && chans == channels ) { return hb_layout; } - hb_log( "Channels reported by ffmpeg (%d) != computed layout channels (%d).", channels, chans ); - switch (channels) + if( !ff_channel_layout ) + { + hb_log( "No channel layout reported by Libav; guessing one from channel count." ); + } + else + { + hb_log( "Channels reported by Libav (%d) != computed layout channels (%d). Guessing layout from channel count.", channels, chans ); + } + switch( channels ) { case 1: hb_layout = HB_INPUT_CH_LAYOUT_MONO; @@ -282,7 +281,7 @@ int hb_ff_layout_xlat(int64_t ff_channel_layout, int channels) hb_layout = HB_INPUT_CH_LAYOUT_3F4R|HB_INPUT_CH_LAYOUT_HAS_LFE; break; default: - hb_log("Unsupported number of audio channels (%d).\n", channels); + hb_log( "Unsupported number of audio channels (%d).", channels ); hb_layout = 0; break; } |