Commit e6511939 authored by Alex Root's avatar Alex Root Committed by Martin Finkel

Fixed possibility to go beyond the border values in player settings.

 - Bug is reproduced in audio delay and subtitle delay sections.
 - Repeated numbers was replaced with int variables.

(cherry picked from commit a068e3cc108c18890ceae35f2969d8a7f420a92c)
parent ab2f213a
......@@ -6,6 +6,8 @@ namespace VLC.Commands.MediaPlayback
{
public class ChangeAudioDelayCommand : AlwaysExecutableCommand
{
private int limit = 3000;
private int step = 50;
public override void Execute(object parameter)
{
if (Locator.MediaPlaybackViewModel.PlaybackService.PlayingType == PlayingType.NotPlaying)
......@@ -15,15 +17,17 @@ namespace VLC.Commands.MediaPlayback
switch (request)
{
case "faster":
if (Locator.MediaPlaybackViewModel.AudioDelay < 3000)
Locator.MediaPlaybackViewModel.AudioDelay += step;
if (Locator.MediaPlaybackViewModel.AudioDelay > limit)
{
Locator.MediaPlaybackViewModel.AudioDelay += 50;
Locator.MediaPlaybackViewModel.AudioDelay = limit;
}
break;
case "slower":
if (Locator.MediaPlaybackViewModel.AudioDelay > -3000)
Locator.MediaPlaybackViewModel.AudioDelay -= step;
if (Locator.MediaPlaybackViewModel.AudioDelay < -limit)
{
Locator.MediaPlaybackViewModel.AudioDelay -= 50;
Locator.MediaPlaybackViewModel.AudioDelay = -limit;
}
break;
case "reset":
......
......@@ -6,6 +6,8 @@ namespace VLC.Commands.MediaPlayback
{
public class ChangeSpuDelayCommand : AlwaysExecutableCommand
{
private int limit = 3000;
private int step = 50;
public override void Execute(object parameter)
{
if (Locator.MediaPlaybackViewModel.PlaybackService.PlayingType == PlayingType.NotPlaying)
......@@ -15,15 +17,17 @@ namespace VLC.Commands.MediaPlayback
switch (request)
{
case "faster":
if (Locator.MediaPlaybackViewModel.SpuDelay < 3000)
Locator.MediaPlaybackViewModel.SpuDelay += step;
if (Locator.MediaPlaybackViewModel.SpuDelay > limit)
{
Locator.MediaPlaybackViewModel.SpuDelay += 50;
Locator.MediaPlaybackViewModel.SpuDelay = limit;
}
break;
case "slower":
if (Locator.MediaPlaybackViewModel.SpuDelay > -3000)
Locator.MediaPlaybackViewModel.SpuDelay -= step;
if (Locator.MediaPlaybackViewModel.SpuDelay < -limit)
{
Locator.MediaPlaybackViewModel.SpuDelay -= 50;
Locator.MediaPlaybackViewModel.SpuDelay = -limit;
}
break;
case "reset":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment