[FFmpeg-cvslog] lavr: return an error if a avresample_open() is called on an open context
Anton Khirnov
git at videolan.org
Sat Feb 22 21:16:21 CET 2014
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Apr 25 20:12:47 2013 +0200| [1db03a68641193832fc759c88049adbe8a449310] | committer: Anton Khirnov
lavr: return an error if a avresample_open() is called on an open context
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1db03a68641193832fc759c88049adbe8a449310
---
libavresample/utils.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavresample/utils.c b/libavresample/utils.c
index 306b67c..63d6530 100644
--- a/libavresample/utils.c
+++ b/libavresample/utils.c
@@ -36,6 +36,11 @@ int avresample_open(AVAudioResampleContext *avr)
{
int ret;
+ if (avresample_is_open(avr)) {
+ av_log(avr, AV_LOG_ERROR, "The resampling context is already open.\n");
+ return AVERROR(EINVAL);
+ }
+
/* set channel mixing parameters */
avr->in_channels = av_get_channel_layout_nb_channels(avr->in_channel_layout);
if (avr->in_channels <= 0 || avr->in_channels > AVRESAMPLE_MAX_CHANNELS) {
More information about the ffmpeg-cvslog
mailing list