mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 03:44:13 +08:00
(PlayFile): don't dispose stream on successful open.
This commit is contained in:
parent
6b1f971160
commit
7b4b755e17
@ -924,7 +924,8 @@ namespace GARbro.GUI
|
||||
try
|
||||
{
|
||||
SetBusyState();
|
||||
using (var input = VFS.OpenBinaryStream (entry))
|
||||
var input = VFS.OpenBinaryStream (entry);
|
||||
try
|
||||
{
|
||||
FormatCatalog.Instance.LastError = null;
|
||||
sound = AudioFormat.Read (input);
|
||||
@ -945,11 +946,17 @@ namespace GARbro.GUI
|
||||
AudioDevice.Init (CurrentAudio);
|
||||
AudioDevice.PlaybackStopped += OnPlaybackStopped;
|
||||
AudioDevice.Play();
|
||||
input = null;
|
||||
var fmt = CurrentAudio.WaveFormat;
|
||||
SetResourceText (string.Format (guiStrings.MsgPlaying, entry.Name,
|
||||
fmt.SampleRate, sound.SourceBitrate / 1000,
|
||||
CurrentAudio.TotalTime.ToString ("m':'ss")));
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (input != null)
|
||||
input.Dispose();
|
||||
}
|
||||
}
|
||||
catch (Exception X)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user