From 106789dfa0cb19142cf8d8dfd38bd006b393a3c2 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 29 Apr 2012 15:30:07 +0200 Subject: [PATCH] swr: add sample format to AudioData Signed-off-by: Michael Niedermayer --- libswresample/swresample.c | 1 + libswresample/swresample_internal.h | 1 + 2 files changed, 2 insertions(+) diff --git a/libswresample/swresample.c b/libswresample/swresample.c index 9297a44ebd..7f545e0aee 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -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); } diff --git a/libswresample/swresample_internal.h b/libswresample/swresample_internal.h index 4f2e9ee4b0..bd46976812 100644 --- a/libswresample/swresample_internal.h +++ b/libswresample/swresample_internal.h @@ -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 {