diff --git a/Unosquare.FFME.Windows.Sample/MainWindow.MediaEvents.cs b/Unosquare.FFME.Windows.Sample/MainWindow.MediaEvents.cs
index 038a9ab5..23f26107 100644
--- a/Unosquare.FFME.Windows.Sample/MainWindow.MediaEvents.cs
+++ b/Unosquare.FFME.Windows.Sample/MainWindow.MediaEvents.cs
@@ -504,25 +504,15 @@ private void OnMediaStateChanged(object sender, MediaStateChangedEventArgs e)
{
var media = sender as MediaElement;
- switch (e.MediaState)
+ ViewModel.PlaybackProgressState = e.MediaState switch
{
- case MediaPlaybackState.Close:
- case MediaPlaybackState.Stop:
- ViewModel.PlaybackProgressState = TaskbarItemProgressState.None;
- break;
- case MediaPlaybackState.Manual:
- case MediaPlaybackState.Pause:
- ViewModel.PlaybackProgressState = TaskbarItemProgressState.Paused;
- break;
- case MediaPlaybackState.Play:
- ViewModel.PlaybackProgressState = media.IsSeekable
- ? TaskbarItemProgressState.Normal
- : TaskbarItemProgressState.Indeterminate;
- break;
- default:
- ViewModel.PlaybackProgressState = TaskbarItemProgressState.None;
- break;
- }
+ MediaPlaybackState.Close or MediaPlaybackState.Stop => TaskbarItemProgressState.None,
+ MediaPlaybackState.Manual or MediaPlaybackState.Pause => TaskbarItemProgressState.Paused,
+ MediaPlaybackState.Play => media.IsSeekable
+ ? TaskbarItemProgressState.Normal
+ : TaskbarItemProgressState.Indeterminate,
+ _ => TaskbarItemProgressState.None,
+ };
}
#endregion
diff --git a/Unosquare.FFME/Commands/CommandManager.cs b/Unosquare.FFME/Commands/CommandManager.cs
index eb805b23..00d96228 100644
--- a/Unosquare.FFME/Commands/CommandManager.cs
+++ b/Unosquare.FFME/Commands/CommandManager.cs
@@ -318,11 +318,12 @@ private void LogReferenceCounter()
if (!Debugger.IsAttached) return;
if (RC.Current.InstancesByLocation.Count <= 0) return;
- var builder = new StringBuilder();
- builder.AppendLine("Unmanaged references are still alive. If there are no further media container instances to be disposed,");
- builder.AppendLine("this is an indication that there is a memory leak. Otherwise, this message can be ignored.");
+ var builder = new StringBuilder()
+ .AppendLine("Unmanaged references are still alive. If there are no further media container instances to be disposed,")
+ .AppendLine("this is an indication that there is a memory leak. Otherwise, this message can be ignored.");
+
foreach (var kvp in RC.Current.InstancesByLocation)
- builder.AppendLine($" {kvp.Key,30} - Instances: {kvp.Value}");
+ _ = builder.AppendLine($" {kvp.Key,30} - Instances: {kvp.Value}");
this.LogError(Aspects.ReferenceCounter, builder.ToString());
}
diff --git a/Unosquare.FFME/Constants.cs b/Unosquare.FFME/Constants.cs
index 072f8206..cddc1d57 100644
--- a/Unosquare.FFME/Constants.cs
+++ b/Unosquare.FFME/Constants.cs
@@ -66,7 +66,7 @@ static Constants()
///
/// The maximum speed ratio.
///
- public static double MaxSpeedRatio => 8.0d;
+ public static double MaxSpeedRatio => 100.0d;
///
/// The minimum balance.