wang-bin / QtAV

A cross-platform multimedia framework based on Qt and FFmpeg. 基于Qt和FFmpeg的跨平台高性能音视频播放框架. Recommand to use new sdk https://github.com/wang-bin/mdk-sdk
http://qtav.org
3.99k stars 1.51k forks source link

Music playback stuttering on Android when player in background #856

Open javlada opened 7 years ago

javlada commented 7 years ago

Hello,

yesterday I compiled new version of my Audio player with QtAV. I use the C++ class QtAV::AVPlayer for playback.

On Android the playback starts to stutter if my application is in background. Is there any possibility to improve this? For example increase the playback buffer?

It is strange that it didn't happen with my previous version which was also built using QtAV 1.11 but Qt 5.6. Now I upgraded to Qt 5.8 and this problem appeared.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/44218557-music-playback-stuttering-on-android-when-player-in-background?utm_campaign=plugin&utm_content=tracker%2F307703&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F307703&utm_medium=issues&utm_source=github).
javlada commented 7 years ago

I tried to set audio buffer: AudioOutput ao; ao.setBufferSamples(10000);

but unfortunately it didn't change anything. Moving the playback to an Android service didn't help neither.

Any other suggestions? Is it for example possible to set the ffmpeg decoder priority?