mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 12:50:49 +08:00
swresample: Check ch layouts in swr_alloc_set_opts2()
This way we can error out earlier Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -68,6 +68,8 @@ int swr_alloc_set_opts2(struct SwrContext **ps,
|
||||
|
||||
if ((ret = av_opt_set_chlayout(s, "ochl", out_ch_layout, 0)) < 0)
|
||||
goto fail;
|
||||
if ((ret = swri_check_chlayout(s, out_ch_layout, "ochl")) < 0)
|
||||
goto fail;
|
||||
|
||||
if ((ret = av_opt_set_int(s, "osf", out_sample_fmt, 0)) < 0)
|
||||
goto fail;
|
||||
@@ -77,6 +79,8 @@ int swr_alloc_set_opts2(struct SwrContext **ps,
|
||||
|
||||
if ((ret = av_opt_set_chlayout(s, "ichl", in_ch_layout, 0)) < 0)
|
||||
goto fail;
|
||||
if ((ret = swri_check_chlayout(s, in_ch_layout, "ichl")) < 0)
|
||||
goto fail;
|
||||
|
||||
if ((ret = av_opt_set_int(s, "isf", in_sample_fmt, 0)) < 0)
|
||||
goto fail;
|
||||
|
||||
Reference in New Issue
Block a user