Skip to content

Commit

Permalink
fixed back button bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Russ committed Jun 4, 2024
1 parent fd02cf0 commit eb0c5f9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions Core/Error.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public enum Error
BadImageData,
BadFrameIndex,
FrameNotReady,
FrameAlreadyReady,
FrameRequestError,
NotImplmeneted,
SeekRequestAlreadyActive,
Expand Down
2 changes: 1 addition & 1 deletion Core/Playback/PlaybackCinemaDNG.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public override Error RequestSeek(uint frame, bool force = false)

// Nothing to do
if (SeekFrame != null && SeekFrame.frameNumber == frame)
return Error.None;
return Error.FrameAlreadyReady;

// If forced, wait for previous work to finish
if ( SeekWork.IsBusy && !force)
Expand Down
6 changes: 5 additions & 1 deletion UI/Common/Window/PlayerWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,12 @@ public void SliderSetValue(string id, double value)

Playback.SeekStart();
var frame = (uint)Math.Round(Playback.FirstFrame + (Playback.LastFrame - Playback.FirstFrame) * value);
Playback.RequestSeek(frame, true);
var seekResult = Playback.RequestSeek(frame, true);
Playback.SeekEnd();

// Manually update playhead if seek failed for a sensible reason
if (seekResult == Error.FrameAlreadyReady)
playhead = (float)value;
}

private Error LoadCustomLUT(string lutPath)
Expand Down

0 comments on commit eb0c5f9

Please sign in to comment.