[FFmpeg-cvslog] avfilter/af_pan: fix regression introduced with switch to new channel layout API

Paul B Mahol git at videolan.org
Tue Feb 7 19:30:33 EET 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Feb  4 21:46:15 2023 +0100| [93a9ee7afd7bf2e019490117f1bada30724a0200] | committer: Paul B Mahol

avfilter/af_pan: fix regression introduced with switch to new channel layout API

Fixes #10168

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=93a9ee7afd7bf2e019490117f1bada30724a0200
---

 libavfilter/af_pan.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c
index 067f646805..80c194b066 100644
--- a/libavfilter/af_pan.c
+++ b/libavfilter/af_pan.c
@@ -313,7 +313,9 @@ static int config_props(AVFilterLink *link)
             pan->channel_map[i] = ch_id;
         }
 
-        av_opt_set_int(pan->swr, "uch", pan->nb_output_channels, 0);
+        av_opt_set_chlayout(pan->swr, "ichl", &link->ch_layout, 0);
+        av_opt_set_chlayout(pan->swr, "ochl", &pan->out_channel_layout, 0);
+        av_opt_set_int(pan->swr, "uch", link->ch_layout.nb_channels, 0);
         swr_set_channel_mapping(pan->swr, pan->channel_map);
     } else {
         // renormalize
@@ -333,6 +335,8 @@ static int config_props(AVFilterLink *link)
             for (j = 0; j < link->ch_layout.nb_channels; j++)
                 pan->gain[i][j] /= t;
         }
+        av_opt_set_chlayout(pan->swr, "ichl", &link->ch_layout, 0);
+        av_opt_set_chlayout(pan->swr, "ochl", &pan->out_channel_layout, 0);
         swr_set_matrix(pan->swr, pan->gain[0], pan->gain[1] - pan->gain[0]);
     }
 



More information about the ffmpeg-cvslog mailing list