diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-04-12 20:50:53 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-04-17 15:20:29 +0200 |
commit | 84fedd3be7685780de8a278f86d0ecb090e6b1c2 (patch) | |
tree | 35beed3860ccec47bcf695b1c0b16d1b91802377 /libswresample/swresample.c | |
parent | 74fb9df48b12acd42b0fe81a67dbbede5ffb88b2 (diff) | |
download | ffmpeg-84fedd3be7685780de8a278f86d0ecb090e6b1c2.tar.gz |
swresample: Allow reinitialization without ever setting channel layouts
(cherry picked from commit 80a28c7509a11114e1aea5b208d56c6646d69c07)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/swresample.c')
-rw-r--r-- | libswresample/swresample.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libswresample/swresample.c b/libswresample/swresample.c index d7344b12a6..c9e5e4d4ae 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; |