summaryrefslogtreecommitdiffstats
path: root/libswresample
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-02-22 22:28:24 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-02-24 08:23:22 +0100
commita66be608883d54fc0970a8b43f4a51a359e664ee (patch)
tree8a4fed53077f85e030e491abe6002983092f5fc8 /libswresample
parent313a6c65b749d87a8735e4bd0f232488797827cb (diff)
downloadffmpeg-streaming-a66be608883d54fc0970a8b43f4a51a359e664ee.zip
ffmpeg-streaming-a66be608883d54fc0970a8b43f4a51a359e664ee.tar.gz
swresample: add swr_is_initialized()
Idea-from/based-on: 7e86c27b4ee9e5a3fbe6cf5249b9d918b2a5e731 Reviewed-by: ubitux Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample')
-rw-r--r--libswresample/swresample.c4
-rw-r--r--libswresample/swresample.h7
-rw-r--r--libswresample/version.h4
3 files changed, 13 insertions, 2 deletions
diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index bc1853f..e11826e 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -733,6 +733,10 @@ static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_co
return out_count;
}
+int swr_is_initialized(struct SwrContext *s) {
+ return !!s->in_buffer.ch_count;
+}
+
int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_count,
const uint8_t *in_arg [SWR_CH_MAX], int in_count){
AudioData * in= &s->in;
diff --git a/libswresample/swresample.h b/libswresample/swresample.h
index 3811301..4ba008e 100644
--- a/libswresample/swresample.h
+++ b/libswresample/swresample.h
@@ -166,6 +166,13 @@ struct SwrContext *swr_alloc(void);
int swr_init(struct SwrContext *s);
/**
+ * Check whether an swr context has been initialized or not.
+ *
+ * @return positive if it has been initialized, 0 if not initialized
+ */
+int swr_is_initialized(struct SwrContext *s);
+
+/**
* Allocate SwrContext if needed and set/reset common parameters.
*
* This function does not require s to be allocated with swr_alloc(). On the
diff --git a/libswresample/version.h b/libswresample/version.h
index 464c86d..3a92875 100644
--- a/libswresample/version.h
+++ b/libswresample/version.h
@@ -29,8 +29,8 @@
#include "libavutil/avutil.h"
#define LIBSWRESAMPLE_VERSION_MAJOR 0
-#define LIBSWRESAMPLE_VERSION_MINOR 17
-#define LIBSWRESAMPLE_VERSION_MICRO 104
+#define LIBSWRESAMPLE_VERSION_MINOR 18
+#define LIBSWRESAMPLE_VERSION_MICRO 100
#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
LIBSWRESAMPLE_VERSION_MINOR, \
OpenPOWER on IntegriCloud