[FFmpeg-cvslog] avfilter/af_sofalizer: pick IR length after loading sofa
Paul B Mahol
git at videolan.org
Sun Dec 23 12:05:07 EET 2018
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Dec 23 11:02:34 2018 +0100| [0c3481b43a198e483a20dcd56b08bb402e529ba3] | committer: Paul B Mahol
avfilter/af_sofalizer: pick IR length after loading sofa
Instead of picking it in preloading stage.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0c3481b43a198e483a20dcd56b08bb402e529ba3
---
libavfilter/af_sofalizer.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/libavfilter/af_sofalizer.c b/libavfilter/af_sofalizer.c
index 0e478f437a..9715f78e88 100644
--- a/libavfilter/af_sofalizer.c
+++ b/libavfilter/af_sofalizer.c
@@ -113,7 +113,6 @@ static int close_sofa(struct MySofa *sofa)
static int preload_sofa(AVFilterContext *ctx, char *filename, int *samplingrate)
{
- struct SOFAlizerContext *s = ctx->priv;
struct MYSOFA_HRTF *mysofa;
char *license;
int ret;
@@ -126,9 +125,8 @@ static int preload_sofa(AVFilterContext *ctx, char *filename, int *samplingrate)
if (mysofa->DataSamplingRate.elements != 1)
return AVERROR(EINVAL);
+ av_log(ctx, AV_LOG_DEBUG, "Original IR length: %d.\n", mysofa->N);
*samplingrate = mysofa->DataSamplingRate.values[0];
- s->sofa.ir_samples = mysofa->N;
- s->sofa.n_samples = 1 << (32 - ff_clz(s->sofa.ir_samples));
license = mysofa_getAttribute(mysofa->attributes, (char *)"License");
if (license)
av_log(ctx, AV_LOG_INFO, "SOFA license: %s\n", license);
@@ -591,6 +589,10 @@ static int load_data(AVFilterContext *ctx, int azim, int elev, float radius, int
return AVERROR_INVALIDDATA;
}
+ av_log(ctx, AV_LOG_DEBUG, "IR length: %d.\n", s->sofa.easy->hrtf->N);
+ s->sofa.ir_samples = s->sofa.easy->hrtf->N;
+ s->sofa.n_samples = 1 << (32 - ff_clz(s->sofa.ir_samples));
+
n_samples = s->sofa.n_samples;
ir_samples = s->sofa.ir_samples;
More information about the ffmpeg-cvslog
mailing list