Browse code

avfilter/fifo: Make independent of the channel layout

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

Michael Niedermayer authored on 2016/09/06 08:13:53
Showing 1 changed files
... ...
@@ -104,7 +104,7 @@ static void queue_pop(FifoContext *s)
104 104
 static void buffer_offset(AVFilterLink *link, AVFrame *frame,
105 105
                           int offset)
106 106
 {
107
-    int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout);
107
+    int nb_channels = link->channels;
108 108
     int planar = av_sample_fmt_is_planar(link->format);
109 109
     int planes = planar ? nb_channels : 1;
110 110
     int block_align = av_get_bytes_per_sample(link->format) * (planar ? 1 : nb_channels);
... ...
@@ -129,7 +129,7 @@ static void buffer_offset(AVFilterLink *link, AVFrame *frame,
129 129
 static int calc_ptr_alignment(AVFrame *frame)
130 130
 {
131 131
     int planes = av_sample_fmt_is_planar(frame->format) ?
132
-                 av_get_channel_layout_nb_channels(frame->channel_layout) : 1;
132
+                 av_frame_get_channels(frame) : 1;
133 133
     int min_align = 128;
134 134
     int p;
135 135
 
... ...
@@ -170,7 +170,7 @@ static int return_audio_frame(AVFilterContext *ctx)
170 170
             buffer_offset(link, head, link->request_samples);
171 171
         }
172 172
     } else {
173
-        int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout);
173
+        int nb_channels = link->channels;
174 174
 
175 175
         if (!s->out) {
176 176
             s->out = ff_get_audio_buffer(link, link->request_samples);