You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which API doesn't behave as documented, and how does it misbehave?
In the - (void)load:(NSDictionary *)source initialPosition:(CMTime)initialPosition initialIndex:(NSNumber *)initialIndex result:(FlutterResult)result method, the _loadResult(@{@"duration": @([self getDurationMicroseconds])}); at line 693 could throw a NPE when the _loadResult is already reported via observeValueForKeyPath at line 814.
if (_indexedAudioSources.count == 0 || !_player.currentItem ||
_player.currentItem.status == AVPlayerItemStatusReadyToPlay) {
_processingState = ready;
_loadResult(@{@"duration": @([self getDurationMicroseconds])}); // <--- the NPE happened here
_loadResult = nil;
} else {
// We send result after the playerItem is ready in observeValueForKeyPath.
}
I'm not sure if observeValueForKeyPath should ever report the duration before the load method, but here in theory the _loadResult could be set to nil and should probably check for it before calling.
Here I attached the crash log trace from xcode via the Organizer > Crashes:
Minimal reproduction project
Unfortunately I couldn't find a way to reproduce this after a lot of tries. I still feel like I should report it as it's quite clear what actually happened here (or should have happened). This only happens to a very small fraction of users that we have.
Expected behavior
In case the duration is already reported via observeValueForKeyPath, the _loadResult doesn't need to be called and should just move on.
Screenshots
N/A
Smartphone (please complete the following information):
Device: iOS
OS: iOS 15-18
Flutter SDK version
[✓] Flutter (Channel stable, 3.24.3, on macOS 15.1.1 24B91 darwin-arm64, locale
en-US)
• Flutter version 3.24.3 on channel stable at
/Users/minzhao/fvm/versions/3.24.3
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2663184aa7 (3 months ago), 2024-09-11 16:27:48 -0500
• Engine revision 36335019a8
• Dart version 3.5.3
• DevTools version 2.37.3
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at /Users/minzhao/Library/Android/sdk
• Platform android-34, build-tools 33.0.1
• ANDROID_HOME = /Users/minzhao/Library/Android/sdk
• ANDROID_SDK_ROOT = /Users/minzhao/Library/Android/sdk
• Java binary at: /Applications/Android
Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
17.0.11+0-17.0.11b1207.24-11852314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16B40
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Oops, it appears that your issue did not follow the template and is missing one or more required sections. Please open a new issue, and provide all required sections and information.
FAQ:
Do I really need to submit a minimal reproduction project for a bug? A: Yes. I prioritise bugs secondarily on how many people are affected, and primarily on whether the bug report is complete, in the sense that it enables me to immediately reproduce it and start working on a fix. If a bug is important to you, the best thing you can do is to provide all requested information ASAP so that I can start looking into it ASAP.
I think I supplied all required information, so did the bot make a mistake? A: The bot only checks the section headings, so when you post a new issue, make sure you leave the section headings intact. (Note that because of this, it is even possible to trick the bot by including only the section headings, and then not providing the requested information under each heading. This is frowned upon, and the issue will be closed manually.)
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with just_audio.
Which API doesn't behave as documented, and how does it misbehave?
In the
- (void)load:(NSDictionary *)source initialPosition:(CMTime)initialPosition initialIndex:(NSNumber *)initialIndex result:(FlutterResult)result
method, the_loadResult(@{@"duration": @([self getDurationMicroseconds])});
at line 693 could throw a NPE when the_loadResult
is already reported viaobserveValueForKeyPath
at line 814.I'm not sure if
observeValueForKeyPath
should ever report the duration before theload
method, but here in theory the_loadResult
could be set tonil
and should probably check for it before calling.Here I attached the crash log trace from xcode via the Organizer > Crashes:
Minimal reproduction project
Unfortunately I couldn't find a way to reproduce this after a lot of tries. I still feel like I should report it as it's quite clear what actually happened here (or should have happened). This only happens to a very small fraction of users that we have.
Error messages
Expected behavior
In case the duration is already reported via
observeValueForKeyPath
, the_loadResult
doesn't need to be called and should just move on.Screenshots
N/A
Smartphone (please complete the following information):
Flutter SDK version
[✓] Flutter (Channel stable, 3.24.3, on macOS 15.1.1 24B91 darwin-arm64, locale
en-US)
• Flutter version 3.24.3 on channel stable at
/Users/minzhao/fvm/versions/3.24.3
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2663184aa7 (3 months ago), 2024-09-11 16:27:48 -0500
• Engine revision 36335019a8
• Dart version 3.5.3
• DevTools version 2.37.3
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at /Users/minzhao/Library/Android/sdk
• Platform android-34, build-tools 33.0.1
• ANDROID_HOME = /Users/minzhao/Library/Android/sdk
• ANDROID_SDK_ROOT = /Users/minzhao/Library/Android/sdk
• Java binary at: /Applications/Android
Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
17.0.11+0-17.0.11b1207.24-11852314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16B40
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build
17.0.11+0-17.0.11b1207.24-11852314)
[✓] VS Code (version 1.95.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.98.0
[✓] Network resources
• All expected network resources are available.
The text was updated successfully, but these errors were encountered: