Skip to content
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

Upgrade ExoPlayer with controllable speed #1

Merged
merged 7 commits into from
Jan 22, 2015

Conversation

mikumi
Copy link

@mikumi mikumi commented Jan 22, 2015

Goal of this pull request

  • Update to Google's most recent ExoPlayer version
  • Port previous speed change modifications to new version

There have been some modifications compared to Hooloop's earlier modifcation:

  • Now support for x86 as well (e.g. Genymotion simulator)
  • This one is using a different approach than previously. Here we preserve the partial buffer writing to audio track so we don't lose performance. Instead, the speed is changed directly before initializing the temporary buffer. Additionally, the channel configuration for libsonic has also been fixed.
    This approach works with all audio file types including vorbis.

Other notes:

  • I am not sure if it is still necessary to set AudioTrack type to AudioManager.STREAM_VOICE_CALL instead of AudioManager.STREAM_MUSIC. This has been directly ported from Hooloop and didn't hurt, so I just left it like that 90f86c6
  • The same goes for changing the DEFAULT_MIN_BUFFER_MULTIPLICATION_FACTOR. This has also been directly ported from Hooloop and didn't hurt, so I just left it like that dd28f61
  • Also I disabled the previous codec fix for Xiaomi as it forced the AAC codec. We need to see if this problem still applies and fix it properly if necessary. 77fd609
  • In case there are any problems with the new MediaCodecAudioTrackRenderer implementation, I added the previous one as an alternative renderer as MediaCodecHooloopAudioTrackRenderer adc6aa5
  • The newest ExoPlayer implements a feature called non-blocking write to AudioTrack. This will only work with Android 5.0+. I have disabled that for our renderer as it requires a different approach for libsonic. It won't be a big change, but it is not required now. Just keep it in mind, I have added todo+notes in code for that.

Ported from Hooloop's Exoplayer modifications
Ported from Hooloop's Exoplayer modifcations
Ported from Hooloop's Exoplayer modifications. Need to check if this problem still applies for other codecs
…p's Exoplayer changes)

Actual buffer rewriting not implemented yet
This is using a different approach than the previous Hooloop version. Here we preserve the partial buffer writing to audio track so we don't lose performance, instead, the speed is changed directly before initializing the temporary buffer. Additionally, the channel configuration for libsonic has also been fixed compared to previous approach.
This approach works with all audio file types including vorbis.
0xthk added a commit that referenced this pull request Jan 22, 2015
…peed

Upgrade ExoPlayer with controllable speed
@0xthk 0xthk merged commit 90c0624 into master Jan 22, 2015
@0xthk 0xthk deleted the enhancement/upgradeExoplayerWithSpeed branch January 22, 2015 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants