summaryrefslogtreecommitdiff
path: root/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegrenderer_p.h
diff options
context:
space:
mode:
authorArtem Dyomin <artem.dyomin@qt.io>2023-04-28 15:09:06 +0200
committerArtem Dyomin <artem.dyomin@qt.io>2023-05-05 12:56:10 +0200
commit925138520fda18b83899e2d60afcbe0612cb5dd8 (patch)
tree6e1d10bac744f7334d75358da02a2a91a5569940 /src/plugins/multimedia/ffmpeg/playbackengine/qffmpegrenderer_p.h
parent04b4b08bc6bfb7d6afa6e729c01ae1bf50389904 (diff)
downloadqtmultimedia-925138520fda18b83899e2d60afcbe0612cb5dd8.tar.gz
Reduce choppy sound on audio playback if audio sink is almost empty
If audio sink buffer is almost empty, that happens on pause/play, the sound pretty often has little gaps. The solution is using some little samples compensation (slows down the playback on 1% for 1-2sec what allows to increase buffer loadig from 0-10% to 20%). In other words, the patch implements slight "soft" audio samples compensation in order to avoid having empty adio sink buffer. Pick-to: 6.5 Change-Id: I6b963996eab8f8b8f610fcd4a566405aec3d13cf Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Diffstat (limited to 'src/plugins/multimedia/ffmpeg/playbackengine/qffmpegrenderer_p.h')
-rw-r--r--src/plugins/multimedia/ffmpeg/playbackengine/qffmpegrenderer_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegrenderer_p.h b/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegrenderer_p.h
index 8949213a4..e0ff9072f 100644
--- a/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegrenderer_p.h
+++ b/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegrenderer_p.h
@@ -75,6 +75,8 @@ protected:
float playbackRate() const;
+ std::chrono::microseconds frameDelay(const Frame &frame) const;
+
private:
void doNextStep() override;