---
doc/APIchanges | 1 +
libavresample/avresample.h | 8 ++++++++
libavresample/utils.c | 5 +++++
3 files changed, 14 insertions(+)
diff --git a/doc/APIchanges b/doc/APIchanges
index dd22711..c6ec9e7 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,7 @@ API changes, most recent first:
2013-04-xx - xxxxxxx - lavr 1.2.0 - avresample.h
Add avresample_get_out_size(), useful for calculating output buffer size.
+ Add avresample_is_open() for checking whether a resample context is open.
2013-03-xx - xxxxxxx - lavc 55.2.0 - avcodec.h
Add CODEC_FLAG_UNALIGNED to allow decoders to produce unaligned output.
diff --git a/libavresample/avresample.h b/libavresample/avresample.h
index de8d9bd..0deddf5 100644
--- a/libavresample/avresample.h
+++ b/libavresample/avresample.h
@@ -172,6 +172,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.
*
* This closes the context, but it does not change the parameters. The context
diff --git a/libavresample/utils.c b/libavresample/utils.c
index e92f8ab..01daa23 100644
--- a/libavresample/utils.c
+++ b/libavresample/utils.c
@@ -255,6 +255,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);
--
1.7.10.4
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel