avfilter: avoid direct access to "frame"->channels
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 10 Mar 2013 10:20:07 +0000 (11:20 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 10 Mar 2013 10:25:54 +0000 (11:25 +0100)
This avoids ABI issues

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/audio.c
libavfilter/avfilter.c

index b5a9f78..1075217 100644 (file)
@@ -69,7 +69,7 @@ AVFrame *ff_default_get_audio_buffer(AVFilterLink *link, int nb_samples)
 
     frame->nb_samples     = nb_samples;
     frame->format         = link->format;
-    frame->channels       = link->channels;
+    av_frame_set_channels(frame, link->channels);
     frame->channel_layout = link->channel_layout;
     frame->sample_rate    = link->sample_rate;
 
index 6717343..ed16c80 100644 (file)
@@ -698,7 +698,7 @@ static int ff_filter_frame_needs_framing(AVFilterLink *link, AVFrame *frame)
 {
     int insamples = frame->nb_samples, inpos = 0, nb_samples;
     AVFrame *pbuf = link->partial_buf;
-    int nb_channels = frame->channels;
+    int nb_channels = av_frame_get_channels(frame);
     int ret = 0;
 
     /* Handle framing (min_samples, max_samples) */
@@ -747,7 +747,7 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
         }
     } else {
         av_assert1(frame->format                == link->format);
-        av_assert1(frame->channels              == link->channels);
+        av_assert1(av_frame_get_channels(frame) == link->channels);
         av_assert1(frame->channel_layout        == link->channel_layout);
         av_assert1(frame->sample_rate           == link->sample_rate);
     }