diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-04-25 20:12:47 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2014-02-22 20:53:09 +0100 |
commit | 1db03a68641193832fc759c88049adbe8a449310 (patch) | |
tree | 2518d59085a2ce04d144c6265ee36541c0e758b6 | |
parent | 7e86c27b4ee9e5a3fbe6cf5249b9d918b2a5e731 (diff) | |
download | ffmpeg-streaming-1db03a68641193832fc759c88049adbe8a449310.zip ffmpeg-streaming-1db03a68641193832fc759c88049adbe8a449310.tar.gz |
lavr: return an error if a avresample_open() is called on an open context
-rw-r--r-- | libavresample/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
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) { |