MediaFoundationPlaybackViewModel.cs

Dec 9, 2012 at 8:21 AM

change

Add Reader.Dispose :: otherwise play the same song ;-)

 

 private bool TryOpenInputFile(string file)
 {
      bool isValid = false;
            try
            {
// Add
		if (reader != null)
		{
			reader.Dispose();
			reader = null;
		}
// change to reader2
                using (var reader2 = new MediaFoundationReader(file))
                {
                    DefaultDecompressionFormat = reader2.WaveFormat.ToString();
                    inputFile = file;
                    isValid = true;
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(String.Format("Not a supported input file ({0})", e.Message));
            }
            return isValid;
        }

Coordinator
Dec 10, 2012 at 8:12 AM

 

thanks, have fixed this