Browse Source

swresample/swresample: fill the correct buffer to print the output layout string

Signed-off-by: James Almer <jamrial@gmail.com>
James Almer 3 năm trước cách đây
mục cha
commit
4ab04fdfb5
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      libswresample/swresample.c

+ 1 - 1
libswresample/swresample.c

@@ -385,8 +385,8 @@ av_cold int swr_init(struct SwrContext *s){
         goto fail;
         goto fail;
     }
     }
 
 
+    av_channel_layout_describe(&s->out_ch_layout, l2, sizeof(l2));
 #if FF_API_OLD_CHANNEL_LAYOUT
 #if FF_API_OLD_CHANNEL_LAYOUT
-    av_channel_layout_describe(&s->out_ch_layout, l1, sizeof(l1));
     if (s->out_ch_layout.order != AV_CHANNEL_ORDER_UNSPEC && s->out.ch_count != s->out_ch_layout.nb_channels) {
     if (s->out_ch_layout.order != AV_CHANNEL_ORDER_UNSPEC && s->out.ch_count != s->out_ch_layout.nb_channels) {
         av_log(s, AV_LOG_ERROR, "Output channel layout %s mismatches specified channel count %d\n", l2, s->out.ch_count);
         av_log(s, AV_LOG_ERROR, "Output channel layout %s mismatches specified channel count %d\n", l2, s->out.ch_count);
         ret = AVERROR(EINVAL);
         ret = AVERROR(EINVAL);