mirror of
https://github.com/devgianlu/librespot-android.git
synced 2026-04-25 21:35:49 +03:00
[PR #20] [MERGED] Make AndroidNativeDecoder working again #22
Labels
No labels
bug
enhancement
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot-android#22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/devgianlu/librespot-android/pull/20
Author: @0xf4b1
Created: 1/30/2023
Status: ✅ Merged
Merged: 1/31/2023
Merged by: @mitschwimmer
Base:
master← Head:android-decoder📝 Commits (3)
366af36PreferAndroidNativeDecoderover built-in librespot-java decodersf974bfdFixMediaExtractorby adding the initial stream position as offsete3ba666Use timeout indequeueOutputBufferand handle the case📊 Changes
2 files changed (+8 additions, -6 deletions)
View changed files
📝
app/src/main/java/xyz/gianlu/librespot/android/LibrespotApp.java(+2 -2)📝
librespot-android-decoder/src/main/java/xyz/gianlu/librespot/player/decoders/AndroidNativeDecoder.java(+6 -4)📄 Description
Hey, first of all many thanks for this great library and demo! :)
I created this PR, because I had some trouble to get the library working in my music player app, so I was interested in the
AndroidNativeDecoderand also encountered some issues.First, after making sure the app does not use the tremolo decoder for ogg decoding on arm devices, the app prefers the build-in decoders over the
AndroidNativeDecoder, so I changed the register part to add them to the front of the list of decoders.Then, when the
AndroidNativeDecoderis being used, I always encounteredDecoderException: No tracks found., but interestingly it worked when writing the full stream into a buffer and reading out of it instead. Then I realized the stream is not at position zero when passed to the decoder, so I added the starting position as offset inMediaDataSourceto get theMediaExtractorworking again.Lastly, the
dequeueOutputBufferblocks indefinitely for me, but I could get it working by specifying a timeout.With these changes, the decoder works great again on my Pixel 6!
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.