OSDN Git Service

lavfi/showwaves: fix floating exception with >8 channels
authorPaul B Mahol <onemda@gmail.com>
Sat, 13 Jul 2013 21:46:27 +0000 (21:46 +0000)
committerPaul B Mahol <onemda@gmail.com>
Sat, 13 Jul 2013 21:46:27 +0000 (21:46 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavfilter/avf_showwaves.c

index e9d3062..52cd60f 100644 (file)
@@ -169,7 +169,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
     AVFrame *outpicref = showwaves->outpicref;
     int linesize = outpicref ? outpicref->linesize[0] : 0;
     int16_t *p = (int16_t *)insamples->data[0];
-    int nb_channels = av_get_channel_layout_nb_channels(insamples->channel_layout);
+    int nb_channels = inlink->channels;
     int i, j, k, h, ret = 0;
     const int n = showwaves->n;
     const int x = 255 / (nb_channels * n); /* multiplication factor, pre-computed to avoid in-loop divisions */