projects
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f8d74cb
)
swr/auto_matrix: treat a single channel as mono instead of failing
author
Michael Niedermayer
<michaelni@gmx.at>
Sat, 8 Sep 2012 19:18:47 +0000
(21:18 +0200)
committer
Michael Niedermayer
<michaelni@gmx.at>
Sat, 8 Sep 2012 19:32:24 +0000
(21:32 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswresample/rematrix.c
patch
|
blob
|
history
diff --git
a/libswresample/rematrix.c
b/libswresample/rematrix.c
index
c4c218d
..
1117f23
100644
(file)
--- a/
libswresample/rematrix.c
+++ b/
libswresample/rematrix.c
@@
-106,6
+106,13
@@
static int clean_layout(SwrContext *s, int64_t layout){
if((layout & AV_CH_LAYOUT_STEREO_DOWNMIX) == AV_CH_LAYOUT_STEREO_DOWNMIX)
return AV_CH_LAYOUT_STEREO;
+ if(layout && layout != AV_CH_FRONT_CENTER && !(layout&(layout-1))) {
+ char buf[128];
+ av_get_channel_layout_string(buf, sizeof(buf), -1, layout);
+ av_log(s, AV_LOG_VERBOSE, "Treating %s as mono\n", buf);
+ return AV_CH_FRONT_CENTER;
+ }
+
return layout;
}