summaryrefslogtreecommitdiff
path: root/libswresample/swresample.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-04-12 20:50:53 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-04-12 22:21:34 +0200
commit80a28c7509a11114e1aea5b208d56c6646d69c07 (patch)
tree3c1771c91c989bee9a47649376b9e6c96807b34d /libswresample/swresample.c
parentd7b9cb2f7a51351586791e65fa22e6536ee58c9f (diff)
swresample: Allow reinitialization without ever setting channel layouts
Diffstat (limited to 'libswresample/swresample.c')
-rw-r--r--libswresample/swresample.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index cb17e1675d..023984c8b2 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -86,10 +86,10 @@ struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
if (av_opt_set_int(s, "tsf", AV_SAMPLE_FMT_NONE, 0) < 0)
goto fail;
- if (av_opt_set_int(s, "ich", av_get_channel_layout_nb_channels(s-> in_ch_layout), 0) < 0)
+ if (av_opt_set_int(s, "ich", av_get_channel_layout_nb_channels(s-> user_in_ch_layout), 0) < 0)
goto fail;
- if (av_opt_set_int(s, "och", av_get_channel_layout_nb_channels(s->out_ch_layout), 0) < 0)
+ if (av_opt_set_int(s, "och", av_get_channel_layout_nb_channels(s->user_out_ch_layout), 0) < 0)
goto fail;
av_opt_set_int(s, "uch", 0, 0);
@@ -168,6 +168,9 @@ av_cold int swr_init(struct SwrContext *s){
s-> in.ch_count = s-> user_in_ch_count;
s->used_ch_count = s->user_used_ch_count;
+ s-> in_ch_layout = s-> user_in_ch_layout;
+ s->out_ch_layout = s->user_out_ch_layout;
+
if(av_get_channel_layout_nb_channels(s-> in_ch_layout) > SWR_CH_MAX) {
av_log(s, AV_LOG_WARNING, "Input channel layout 0x%"PRIx64" is invalid or unsupported.\n", s-> in_ch_layout);
s->in_ch_layout = 0;