-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes a crash that can happen when playing a corrupted file #901
Open
emilylaguna
wants to merge
20
commits into
trunk
Choose a base branch
from
fix/player-crash
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
32deec2
Add a isNumeric check to prevent a crash
emilylaguna 3f8007d
Update CHANGELOG.md
emilylaguna 2c98d0c
Throw a playback error if the AVAudioFile.length returns 0 when loadi…
emilylaguna cf19c0e
Provide more context about throwing the effects player frame count error
emilylaguna 16ce5b0
Add playbackFailed to the analytics events
emilylaguna 9e3e908
Change PlaybackError to conform to LocalizedError
emilylaguna 59f8601
Throw a more specific effectsPlayerFrameCountZero error from the effe…
emilylaguna 0709508
Add a playbackFailed method to the AnalyticsPlaybackHelper
emilylaguna 474236e
Set the userInitiated flag to false on the pause method when a playba…
emilylaguna 614b02e
Track when a playback error occurs
emilylaguna 446326f
Add more specific information if the DefaultPlayer fails to play
emilylaguna 891822d
Remove the playback_failed analytics source since its been replaced b…
emilylaguna e0011ae
Keep track of the previous analytics source
emilylaguna 01a115b
If there is no analytics source on playback fail, then revert to the …
emilylaguna ef3a51d
Add AnalyticsDescribable support to the players
emilylaguna 1611c68
Pass the current player to the playbackFailed event
emilylaguna 7e7730d
Move the analytics source fallback to the analytics coordinator
emilylaguna e04fc56
Add current source fallback tests
emilylaguna 9ff7847
Fix lint
emilylaguna 2bde5cc
Merge pull request #918 from Automattic/task/add-playback-failed-events
emilylaguna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,6 +98,11 @@ class EffectsPlayer: PlaybackProtocol, Hashable { | |
// we haven't cached a frame count for this episode, do that now | ||
strongSelf.cachedFrameCount = strongSelf.audioFile!.length | ||
DataManager.sharedManager.saveFrameCount(episode: episode, frameCount: strongSelf.cachedFrameCount) | ||
|
||
// If the count is still 0 then way may not be able to read the file correctly, so throw an error | ||
if strongSelf.cachedFrameCount == 0 { | ||
throw PlaybackError.unableToOpenFile | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we add tracking here to know how often this happens? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great idea! I did this in a separate PR since there were some changes that were a bit more involved: #918 |
||
} | ||
} | ||
} catch { | ||
objc_sync_exit(strongSelf.playerLock) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be we instead of way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🫣 oops, fixed here: cf19c0e