diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-08-04 18:38:42 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2019-08-04 18:38:45 +0200 |
commit | a2951212724953ca61020759415befdca72599ff (patch) | |
tree | 60a9e809b839933f703f36c5b836f340d8e9905a /src | |
parent | 8103563530e6e5711f20bfef97141421520341fb (diff) |
Limit video buffer
Diffstat (limited to 'src')
-rw-r--r-- | src/VideoPlayer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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 <clocale> 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"); |