A game framework written with osu! in mind.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Split out and combine seek to sync method

+9 -7
+9 -7
osu.Framework/Graphics/Video/Video.cs
··· 121 121 { 122 122 // if at the end of the stream but our playback enters a valid time region again, a seek operation is required to get the decoder back on track. 123 123 if (PlaybackPosition < decoder.Duration) 124 - { 125 - decoder.Seek(PlaybackPosition); 126 - availableFrames.Clear(); 127 - } 124 + seekIntoSync(); 128 125 } 129 126 130 127 var nextFrame = availableFrames.Count > 0 ? availableFrames.Peek() : null; ··· 141 138 if (tooFarBehind && decoder.CanSeek) 142 139 { 143 140 Logger.Log($"Video too far out of sync ({nextFrame.Time}), seeking to {PlaybackPosition}"); 144 - decoder.Seek(PlaybackPosition); 145 - decoder.ReturnFrames(availableFrames); 146 - availableFrames.Clear(); 141 + seekIntoSync(); 147 142 } 148 143 } 149 144 ··· 174 169 175 170 if (frameTime != CurrentFrameTime) 176 171 FramesProcessed++; 172 + 173 + void seekIntoSync() 174 + { 175 + decoder.Seek(PlaybackPosition); 176 + decoder.ReturnFrames(availableFrames); 177 + availableFrames.Clear(); 178 + } 177 179 } 178 180 179 181 private bool checkNextFrameValid(DecodedFrame frame)