[SCM] libav/experimental: lavr: return an error if a avresample_open() is called on an open context

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Aug 10 16:01:28 UTC 2014


The following commit has been merged in the experimental branch:
commit 1db03a68641193832fc759c88049adbe8a449310
Author: Anton Khirnov <anton at khirnov.net>
Date:   Thu Apr 25 20:12:47 2013 +0200

    lavr: return an error if a avresample_open() is called on an open context

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) {

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list