Skip to content

audiotrack: do not call deprecated setLegacyStreamType() on Android API level 26+

Sean McGovern requested to merge sean_mcg/vlc:android_api26_audio into master

Logs from #25302 (closed) expose this annoying warning:

12-13 19:53:18.042 W/AudioTrack( 3934): Use of stream types is deprecated for operations other than volume control
12-13 19:53:18.042 W/AudioTrack( 3934): See the documentation of AudioTrack() for what to use instead with android.media.AudioAttributes to qualify your playback use case

Poked around a bit and found this on the Android developer site. It looks like vlc-android is already handling audio focus correctly, but it would be nice to banish the extra log entry on devices running Android API 26+.

Please note this is untested which is why I am marking it as Draft. Is there an emulator in the SDK I can use to test it?

Edited by Sean McGovern

Merge request reports

Loading