Added custom support for MpqFileHandle#read() to support audio playback

Audio playback required FileHandle reference, can't pass stream directly
Audio classes call FileHandle#read()
This commit is contained in:
Collin Smith 2021-12-02 22:28:47 -08:00
parent 264a7a9630
commit c70c008861

View File

@ -482,7 +482,10 @@ public final class MpqFileHandle extends FileHandle implements ReferenceCounted
@Override
public InputStream read() {
return unsupported("not supported for mpq files");
// required by music files, restricting for everything else
return FilenameUtils.isExtension(filename, "WAV")
? stream(true)
: unsupported("not supported for mpq files");
}
@Override