summaryrefslogtreecommitdiff
path: root/libswresample
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-06 19:17:38 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-06 20:21:40 +0200
commit67b2df792fed29b806cc94213dbd6558d8e717df (patch)
treee187f47f7494037baf56ea238c934cea68f1b489 /libswresample
parent696a780c47f57009727597509cc1c018c1c3152d (diff)
swresample: Try to handle cases with input channel count and layout mismatching.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample')
-rw-r--r--libswresample/swresample.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index 65591f3a32..c7b206e14c 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -177,6 +177,11 @@ int swr_init(SwrContext *s){
return -1;
}
+ if(s-> in.ch_count && s->in.ch_count != av_get_channel_layout_nb_channels(s-> in_ch_layout)){
+ av_log(s, AV_LOG_WARNING, "Input channel layout has a different number of channels than there actually is, ignoring layout\n");
+ s-> in_ch_layout= 0;
+ }
+
if(!s-> in_ch_layout)
s-> in_ch_layout= guess_layout(s->in.ch_count);
if(!s->out_ch_layout)