diff mbox

[FFmpeg-devel,2/2] avfilter/fifo: Make independent of the channel layout

Message ID 20160905231353.32269-2-michael@niedermayer.cc
State Accepted
Commit fdd9663781e3ebc8ebed0704607abd174095a905
Headers show

Commit Message

Michael Niedermayer Sept. 5, 2016, 11:13 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavfilter/fifo.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Paul B Mahol Sept. 5, 2016, 11:34 p.m. UTC | #1
On 9/6/16, Michael Niedermayer <michael@niedermayer.cc> wrote:
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavfilter/fifo.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>

should be ok
Michael Niedermayer Sept. 6, 2016, 10:15 a.m. UTC | #2
On Tue, Sep 06, 2016 at 01:34:19AM +0200, Paul B Mahol wrote:
> On 9/6/16, Michael Niedermayer <michael@niedermayer.cc> wrote:
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavfilter/fifo.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> 
> should be ok

applied

thx

[...]
Nicolas George Sept. 10, 2016, 9:24 a.m. UTC | #3
Le primidi 21 fructidor, an CCXXIV, Michael Niedermayer a écrit :
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavfilter/fifo.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/libavfilter/fifo.c b/libavfilter/fifo.c
> index f0b77ff..abfbba1 100644
> --- a/libavfilter/fifo.c
> +++ b/libavfilter/fifo.c
> @@ -104,7 +104,7 @@ static void queue_pop(FifoContext *s)
>  static void buffer_offset(AVFilterLink *link, AVFrame *frame,
>                            int offset)
>  {
> -    int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout);
> +    int nb_channels = link->channels;
>      int planar = av_sample_fmt_is_planar(link->format);
>      int planes = planar ? nb_channels : 1;
>      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,
>  static int calc_ptr_alignment(AVFrame *frame)
>  {
>      int planes = av_sample_fmt_is_planar(frame->format) ?
> -                 av_get_channel_layout_nb_channels(frame->channel_layout) : 1;

> +                 av_frame_get_channels(frame) : 1;

Does the limitation on using AVFrame.channels directly still apply.

>      int min_align = 128;
>      int p;
>  
> @@ -170,7 +170,7 @@ static int return_audio_frame(AVFilterContext *ctx)
>              buffer_offset(link, head, link->request_samples);
>          }
>      } else {
> -        int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout);
> +        int nb_channels = link->channels;
>  
>          if (!s->out) {
>              s->out = ff_get_audio_buffer(link, link->request_samples);

LGTM, but I am not maintainer of that file.

Regards,
diff mbox

Patch

diff --git a/libavfilter/fifo.c b/libavfilter/fifo.c
index f0b77ff..abfbba1 100644
--- a/libavfilter/fifo.c
+++ b/libavfilter/fifo.c
@@ -104,7 +104,7 @@  static void queue_pop(FifoContext *s)
 static void buffer_offset(AVFilterLink *link, AVFrame *frame,
                           int offset)
 {
-    int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout);
+    int nb_channels = link->channels;
     int planar = av_sample_fmt_is_planar(link->format);
     int planes = planar ? nb_channels : 1;
     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,
 static int calc_ptr_alignment(AVFrame *frame)
 {
     int planes = av_sample_fmt_is_planar(frame->format) ?
-                 av_get_channel_layout_nb_channels(frame->channel_layout) : 1;
+                 av_frame_get_channels(frame) : 1;
     int min_align = 128;
     int p;
 
@@ -170,7 +170,7 @@  static int return_audio_frame(AVFilterContext *ctx)
             buffer_offset(link, head, link->request_samples);
         }
     } else {
-        int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout);
+        int nb_channels = link->channels;
 
         if (!s->out) {
             s->out = ff_get_audio_buffer(link, link->request_samples);