Skip to content

Commit 122b8c4

Browse files
committed
AlAudioRenderer: update OpenAL state when dry filter is re-applied (#1728)
* ALAudioRenderer: update direct-filter ID even when filter is up-to-date * ALAudioRenderer: update the copyright dates
1 parent 1c7e951 commit 122b8c4

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2021 jMonkeyEngine
2+
* Copyright (c) 2009-2022 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -503,18 +503,18 @@ public void updateSourceParam(AudioSource src, AudioParam param) {
503503
if (!supportEfx) {
504504
return;
505505
}
506-
507-
if (src.getDryFilter() != null) {
508-
Filter f = src.getDryFilter();
509-
if (f.isUpdateNeeded()) {
510-
updateFilter(f);
511-
512-
// NOTE: must re-attach filter for changes to apply.
513-
al.alSourcei(id, EFX.AL_DIRECT_FILTER, f.getId());
514-
}
506+
Filter dryFilter = src.getDryFilter();
507+
int filterId;
508+
if (dryFilter == null) {
509+
filterId = EFX.AL_FILTER_NULL;
515510
} else {
516-
al.alSourcei(id, EFX.AL_DIRECT_FILTER, EFX.AL_FILTER_NULL);
511+
if (dryFilter.isUpdateNeeded()) {
512+
updateFilter(dryFilter);
513+
}
514+
filterId = dryFilter.getId();
517515
}
516+
// NOTE: must re-attach filter for changes to apply.
517+
al.alSourcei(id, EFX.AL_DIRECT_FILTER, filterId);
518518
break;
519519
case Looping:
520520
if (src.isLooping() && !(src.getAudioData() instanceof AudioStream)) {

0 commit comments

Comments
 (0)