Comments (4)
Could reproduce with a single-song queue. This seems like another thing I forgot to test with gapless playback. Thanks for reporting this.
from auxio.
I stumbled onto this bug while looking into #733. Not sure if you're already working on this @OxygenCobalt, but thought I'd mention it here anyway.
This bug doesn't just affect single-song queues. It occurs whenever you try to use "Play next" on the last song of a queue. I've put the (truncated) stracktrace you get when the crash happens below:
FATAL EXCEPTION: main
Process: org.oxycblt.auxio.debug, PID: 11379
java.lang.IllegalArgumentException
at androidx.media3.common.util.Assertions.checkArgument(Assertions.java:40)
at androidx.media3.exoplayer.ExoPlayerImpl.addMediaSources(ExoPlayerImpl.java:661)
at androidx.media3.exoplayer.ExoPlayerImpl.addMediaItems(ExoPlayerImpl.java:637)
at org.oxycblt.auxio.playback.system.PlaybackService.playNext(PlaybackService.kt:380)
...
From this, I think I can see the cause. When you run getNextMediaItemIndex()
at the end of a playlist, you get back C.INDEX_UNSET
(-1
). This value fails the argument check in ExoPlayerImpl.addMediaSources()
:
checkArgument(index >= 0)
I'm pretty sure you can fix this with a check in PlaybackService.playNext()
, something like this maybe?
val nextIndex = player.nextMediaItemIndex
if (nextIndex == C.INDEX_UNSET) {
player.addMediaItems(songs.map { it.toMediaItem() })
} else {
player.addMediaItems(nextIndex, songs.map { it.toMediaItem() })
}
If you want I can make a PR for this: just let me know which branch you want me to merge into as I think dev
is a little behind on some shuffle order hotfixes.
from auxio.
You're probably right about this @unrenowned. Feel free to branch off hotfixes
and make a patch PR, I'm super busy right now.
from auxio.
Resolved in #748. Will arrive in a hotfix release eventually.
from auxio.
Related Issues (20)
- Playlist Sorting by date added HOT 3
- Ill pay if you can tweak some stuff for me HOT 9
- Can a mini player overlay be used to play files directly? HOT 1
- I wish they'd eliminate the white space on the album cover. HOT 2
- Added a feature to stop music playback and close the app when the app is removed from the "Recently Used Apps" list by swiping it. HOT 1
- Development is slow right now HOT 1
- Swiping down on More Options creates an empty menu HOT 2
- Dynamic playlist sorting HOT 4
- Sorting songs by date does not work as expected HOT 1
- Redesigned playlist selection HOT 1
- Warn before adding duplicate songs in playlists HOT 11
- Support for android auto HOT 1
- Experiment with caching music grouping
- Do not load cover art in music loader HOT 8
- Repeat does not work HOT 4
- Name sorting not working properly HOT 1
- Overscroll to refresh library HOT 1
- Disabling auxio service HOT 2
- Track cover is displayed wrong HOT 3
- sort artists/albums/playlists by recently played HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auxio.