Commit a66be608 authored by Michael Niedermayer's avatar Michael Niedermayer

swresample: add swr_is_initialized()

Idea-from/based-on: 7e86c27b
Reviewed-by: ubitux
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 313a6c65
...@@ -15,6 +15,9 @@ libavutil: 2012-10-22 ...@@ -15,6 +15,9 @@ libavutil: 2012-10-22
API changes, most recent first: API changes, most recent first:
2014-02-xx - xxxxxxx - lswr 0.18.100 - swresample.h
Add swr_is_initialized() for checking whether a resample context is initialized.
2014-02-xx - xxxxxxx - lavr 1.2.0 - avresample.h 2014-02-xx - xxxxxxx - lavr 1.2.0 - avresample.h
Add avresample_is_open() for checking whether a resample context is open. Add avresample_is_open() for checking whether a resample context is open.
......
...@@ -733,6 +733,10 @@ static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_co ...@@ -733,6 +733,10 @@ static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_co
return out_count; 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, 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){ const uint8_t *in_arg [SWR_CH_MAX], int in_count){
AudioData * in= &s->in; AudioData * in= &s->in;
......
...@@ -165,6 +165,13 @@ struct SwrContext *swr_alloc(void); ...@@ -165,6 +165,13 @@ struct SwrContext *swr_alloc(void);
*/ */
int swr_init(struct SwrContext *s); 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. * Allocate SwrContext if needed and set/reset common parameters.
* *
......
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
#include "libavutil/avutil.h" #include "libavutil/avutil.h"
#define LIBSWRESAMPLE_VERSION_MAJOR 0 #define LIBSWRESAMPLE_VERSION_MAJOR 0
#define LIBSWRESAMPLE_VERSION_MINOR 17 #define LIBSWRESAMPLE_VERSION_MINOR 18
#define LIBSWRESAMPLE_VERSION_MICRO 104 #define LIBSWRESAMPLE_VERSION_MICRO 100
#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ #define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
LIBSWRESAMPLE_VERSION_MINOR, \ LIBSWRESAMPLE_VERSION_MINOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment