From 7e86c27b4ee9e5a3fbe6cf5249b9d918b2a5e731 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 25 Apr 2013 20:08:49 +0200 Subject: lavr: add a function for checking whether AVAudioResampleContext is open --- libavresample/avresample.h | 8 ++++++++ libavresample/utils.c | 5 +++++ libavresample/version.h | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'libavresample') diff --git a/libavresample/avresample.h b/libavresample/avresample.h index d26f2ca223..3358628e37 100644 --- a/libavresample/avresample.h +++ b/libavresample/avresample.h @@ -171,6 +171,14 @@ AVAudioResampleContext *avresample_alloc_context(void); */ int avresample_open(AVAudioResampleContext *avr); +/** + * Check whether an AVAudioResampleContext is open or closed. + * + * @param avr AVAudioResampleContext to check + * @return 1 if avr is open, 0 if avr is closed. + */ +int avresample_is_open(AVAudioResampleContext *avr); + /** * Close AVAudioResampleContext. * diff --git a/libavresample/utils.c b/libavresample/utils.c index 2dd3d0616f..306b67c7ad 100644 --- a/libavresample/utils.c +++ b/libavresample/utils.c @@ -254,6 +254,11 @@ error: return ret; } +int avresample_is_open(AVAudioResampleContext *avr) +{ + return !!avr->out_fifo; +} + void avresample_close(AVAudioResampleContext *avr) { ff_audio_data_free(&avr->in_buffer); diff --git a/libavresample/version.h b/libavresample/version.h index fce5770c62..ca836e4a56 100644 --- a/libavresample/version.h +++ b/libavresample/version.h @@ -28,7 +28,7 @@ #include "libavutil/version.h" #define LIBAVRESAMPLE_VERSION_MAJOR 1 -#define LIBAVRESAMPLE_VERSION_MINOR 1 +#define LIBAVRESAMPLE_VERSION_MINOR 2 #define LIBAVRESAMPLE_VERSION_MICRO 0 #define LIBAVRESAMPLE_VERSION_INT AV_VERSION_INT(LIBAVRESAMPLE_VERSION_MAJOR, \ -- cgit v1.2.3