Skip to content

Commit cf19c0e

Browse files
committed
Provide more context about throwing the effects player frame count error
1 parent 2c98d0c commit cf19c0e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

podcasts/EffectsPlayer.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ class EffectsPlayer: PlaybackProtocol, Hashable {
9999
strongSelf.cachedFrameCount = strongSelf.audioFile!.length
100100
DataManager.sharedManager.saveFrameCount(episode: episode, frameCount: strongSelf.cachedFrameCount)
101101

102-
// If the count is still 0 then way may not be able to read the file correctly, so throw an error
102+
// Throw an error if the frame count is 0
103+
// `cachedFrameCount` is used to calculate the duration of the episode and a 0 value
104+
// will result in the episode immediately being marked as played or can cause Inf/NaN issues.
105+
//
106+
// For more info, see: https://github.com/Automattic/pocket-casts-ios/issues/900
103107
if strongSelf.cachedFrameCount == 0 {
104108
throw PlaybackError.unableToOpenFile
105109
}

0 commit comments

Comments
 (0)