[005/200] avtools: Use the new channel layout API in AVFrame

Message ID 20170517174712.8625-6-vittorio.giovara@gmail.com
State New
Headers show

Commit Message

Vittorio Giovara May 17, 2017, 5:46 p.m.
---
 avtools/avconv.c        | 2 +-
 avtools/avconv_filter.c | 2 +-
 avtools/avplay.c        | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

Comments

Luca Barbato May 23, 2017, 8:10 p.m. | #1
On 5/17/17 7:46 PM, Vittorio Giovara wrote:
> ---
>  avtools/avconv.c        | 2 +-
>  avtools/avconv_filter.c | 2 +-
>  avtools/avplay.c        | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)

Seems ok.

Patch

diff --git a/avtools/avconv.c b/avtools/avconv.c
index 2e218e96c7..755af3a3e8 100644
--- a/avtools/avconv.c
+++ b/avtools/avconv.c
@@ -1203,7 +1203,7 @@  static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame)
     switch (ifilter->ist->st->codecpar->codec_type) {
     case AVMEDIA_TYPE_AUDIO:
         need_reinit |= ifilter->sample_rate    != frame->sample_rate ||
-                       ifilter->channel_layout != frame->channel_layout;
+                       ifilter->channel_layout != frame->ch_layout.u.mask;
         break;
     case AVMEDIA_TYPE_VIDEO:
         need_reinit |= ifilter->width  != frame->width ||
diff --git a/avtools/avconv_filter.c b/avtools/avconv_filter.c
index 884478da27..e719c06658 100644
--- a/avtools/avconv_filter.c
+++ b/avtools/avconv_filter.c
@@ -798,7 +798,7 @@  int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame)
     ifilter->sample_aspect_ratio = frame->sample_aspect_ratio;
 
     ifilter->sample_rate         = frame->sample_rate;
-    ifilter->channel_layout      = frame->channel_layout;
+    ifilter->channel_layout      = frame->ch_layout.u.mask;
 
     if (frame->hw_frames_ctx) {
         ifilter->hw_frames_ctx = av_buffer_ref(frame->hw_frames_ctx);
diff --git a/avtools/avplay.c b/avtools/avplay.c
index b6dbc52cf7..6cc63258fc 100644
--- a/avtools/avplay.c
+++ b/avtools/avplay.c
@@ -1837,11 +1837,11 @@  static int audio_decode_frame(PlayerState *is, double *pts_ptr)
                                                    is->frame->format, 1);
 
             audio_resample = is->frame->format         != is->sdl_sample_fmt     ||
-                             is->frame->channel_layout != is->sdl_channel_layout ||
+                             is->frame->ch_layout.u.mask != is->sdl_channel_layout ||
                              is->frame->sample_rate    != is->sdl_sample_rate;
 
             resample_changed = is->frame->format         != is->resample_sample_fmt     ||
-                               is->frame->channel_layout != is->resample_channel_layout ||
+                               is->frame->ch_layout.u.mask != is->resample_channel_layout ||
                                is->frame->sample_rate    != is->resample_sample_rate;
 
             if ((!is->avr && audio_resample) || resample_changed) {