diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-12-29 22:51:50 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-12-29 22:51:50 +0000 |
| commit | a5ea5c0d2637dd41e3d356cb62cac75b8cadf8ce (patch) | |
| tree | 45ed553eeaf52a58dea79f66ab6345df1c1657d0 /src/lib/butler.cc | |
| parent | 1701be8b9173c675169b5739fbd94f5e6f8d07d1 (diff) | |
Add basic memory-used stuff for butler and reduce minimum audio
readahead quite a bit. This in turn reduces the maximum butler memory
usage as it will keep getting audio (and hence video) until the
minimum audio readahead is hit.
Diffstat (limited to 'src/lib/butler.cc')
| -rw-r--r-- | src/lib/butler.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/butler.cc b/src/lib/butler.cc index fd4b824a5..56f8919f5 100644 --- a/src/lib/butler.cc +++ b/src/lib/butler.cc @@ -29,6 +29,7 @@ using std::cout; using std::pair; using std::make_pair; +using std::string; using boost::weak_ptr; using boost::shared_ptr; using boost::bind; @@ -39,9 +40,9 @@ using boost::optional; /** Maximum video readahead in frames; should never be reached unless there are bugs in Player */ #define MAXIMUM_VIDEO_READAHEAD 24 /** Minimum audio readahead in frames */ -#define MINIMUM_AUDIO_READAHEAD (48000*5) +#define MINIMUM_AUDIO_READAHEAD (48000 * MINIMUM_VIDEO_READAHEAD / 24) /** Minimum audio readahead in frames; should never be reached unless there are bugs in Player */ -#define MAXIMUM_AUDIO_READAHEAD (48000*60) +#define MAXIMUM_AUDIO_READAHEAD (48000 * MAXIMUM_VIDEO_READAHEAD / 24) #define LOG_WARNING(...) _log->log (String::compose(__VA_ARGS__), LogEntry::TYPE_WARNING); @@ -254,3 +255,10 @@ Butler::disable_audio () boost::mutex::scoped_lock lm (_mutex); _disable_audio = true; } + +pair<size_t, string> +Butler::memory_used () const +{ + /* XXX: should also look at _audio.memory_used() */ + return _video.memory_used(); +} |
