swr: add sample format to AudioData
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 29 Apr 2012 13:30:07 +0000 (15:30 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 29 Apr 2012 13:32:18 +0000 (15:32 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswresample/swresample.c
libswresample/swresample_internal.h

index 9297a44..7f545e0 100644 (file)
@@ -154,6 +154,7 @@ struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
 }
 
 static void set_audiodata_fmt(AudioData *a, enum AVSampleFormat fmt){
+    a->fmt   = fmt;
     a->bps   = av_get_bytes_per_sample(fmt);
     a->planar= av_sample_fmt_is_planar(fmt);
 }
index 4f2e9ee..bd46976 100644 (file)
@@ -30,6 +30,7 @@ typedef struct AudioData{
     int bps;                    ///< bytes per sample
     int count;                  ///< number of samples
     int planar;                 ///< 1 if planar audio, 0 otherwise
+    enum AVSampleFormat fmt;    ///< sample format
 } AudioData;
 
 struct SwrContext {