From a2951212724953ca61020759415befdca72599ff Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 4 Aug 2019 18:38:42 +0200 Subject: Limit video buffer --- src/VideoPlayer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/VideoPlayer.cpp') diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp index 96ba6ef..210a2ca 100644 --- a/src/VideoPlayer.cpp +++ b/src/VideoPlayer.cpp @@ -6,11 +6,11 @@ #include namespace QuickMedia { - void* getProcAddressMpv(void *funcContext, const char *name) { + static void* getProcAddressMpv(void *funcContext, const char *name) { return (void*)sf::Context::getFunction(name); } - void onMpvRedraw(void *rawVideo) { + static void onMpvRedraw(void *rawVideo) { VideoPlayer *video_player = (VideoPlayer*)rawVideo; ++video_player->redrawCounter; } @@ -35,6 +35,9 @@ namespace QuickMedia { mpv_set_option_string(mpv, "input-default-bindings", "yes"); mpv_set_option_string(mpv, "input-vo-keyboard", "yes"); + mpv_set_option_string(mpv, "cache-secs", "120"); + mpv_set_option_string(mpv, "demuxer-max-bytes", "20M"); + mpv_set_option_string(mpv, "demuxer-max-back-bytes", "10M"); if(mpv_initialize(mpv) < 0) throw VideoInitializationException("Failed to initialize mpv"); -- cgit v1.2.3