Fixed AssetBrowserLogic disposing audio streams prematurely
This commit is contained in:
committed by
Matthias Mailänder
parent
6fb228ddd1
commit
b6b417d42f
@@ -481,11 +481,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
// Mute music so it doesn't interfere with the current asset.
|
// Mute music so it doesn't interfere with the current asset.
|
||||||
MuteSounds();
|
MuteSounds();
|
||||||
|
|
||||||
using (var soundStream = Game.ModData.DefaultFileSystem.Open(prefix + filename))
|
currentAudioStream = Game.ModData.DefaultFileSystem.Open(prefix + filename);
|
||||||
{
|
|
||||||
foreach (var modDataSoundLoader in Game.ModData.SoundLoaders)
|
foreach (var modDataSoundLoader in Game.ModData.SoundLoaders)
|
||||||
{
|
{
|
||||||
if (modDataSoundLoader.TryParseSound(soundStream, out currentSoundFormat))
|
if (modDataSoundLoader.TryParseSound(currentAudioStream, out currentSoundFormat))
|
||||||
{
|
{
|
||||||
if (frameSlider != null)
|
if (frameSlider != null)
|
||||||
{
|
{
|
||||||
@@ -497,7 +496,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (allowedVideoExtensions.Contains(fileExtension))
|
else if (allowedVideoExtensions.Contains(fileExtension))
|
||||||
{
|
{
|
||||||
// Mute music so it doesn't interfere with the current asset.
|
// Mute music so it doesn't interfere with the current asset.
|
||||||
|
|||||||
Reference in New Issue
Block a user