Skip to content
This repository

Network Cache Redux #1388

Closed
wants to merge 1 commit into from

20 participants

classicspam silvermir arnova mgehre tompen- huceke bobo1on1 Jellyfrog Markus Doits JohnHoek XBian rbej Koenkk popcornmix divadnivip007 seddonm1 slakbmc mtisza NedScott Martijn Kaijser
classicspam

Based on PR 831

PR 831 Inclusions (credit goes to bobo1on1):

  • Use Free Ram Percentage as Buffer Size
  • Adjust Read Rate Based On Max Bitrate

Enhancements to PR 831:

  • move variables over to advanced settings under section ("alwaysforcebuffer" default false and "freememorycachepercent" default 50% max 80% with hard limit of 1GB and 0 value will force filecache. It also removes "cachemembuffersize" variable as it is no longer needed)

  • "alwaysforcebuffer" variable will cache everything run through dvdplayer (i.e. OS network shares, local media, etc) except Optical Media Drives

  • Memory buffer is straight percentage of free ram (i.e. if 50% free ram is used ~75% of the 50% will be forward looking buffer and ~25% of the 50% will be back buffer)

  • Rate limiting which fixes SMB issues with PR 831 as far as I can tell (no issues with testing for 1+ months on Windows, Linux and ATV2 devices) (1.25 times max bitrate up to 40 MB/s in which case it is throttled to max bitrate)

  • ios and linux fixes

Advanced Settings Notes: This PR adds 2 setting under advanced settings and removes the "cachemembuffersize" setting as it is no longer needed. The added settings are as follows:

  1. alwaysforcebuffer: This will force everything ran through dvdplayer to be buffered that would not be normal buffered except Optical Media. This includes SMB, Local Files, OS Network Shares, etc. The current default is false due to it not really being a help to people who use hardwired connections (as they probably do not need buffering for SMB, etc).

  2. "freememorycachepercent": The amount of free memory to use as buffer size. Please note that of the percentage of free memory used ~75% will be used for forward buffering and ~25% will be used for the back buffer. The default is 50% which is a good default for memory limted devices such as the atv2. The max is 80 percent and there is a hard limit of 1GB buffer size irregardless of free ram. Setting it to 0 will force filecaching (same as the way cachemembuffersize was used)

silvermir

how can i try this with windows? i have issues with smb & vpn on a windows client!

Deleted user

if you don't know you shouldn't be in here. simple as that.

silvermir

sorry but i try to get smb working more than 2 weeks and i really want to try it so i can give a feedback. just tell me if its possible please.

arnova
Collaborator

Everything is possible but without enough knowledge about both git and compiling/building I'd probably use my time/efforts for other things...

mgehre

+1 for making sshfs mounts usable

tompen-

Should OMXPlayer.cpp also have ReadRate changes?

huceke
Collaborator

@tompen: yes. i'll add it when it is merged.

tompen-

Tested on OMXPlayer with ftp and smb source. I noticed the following:

For Raspberry Pi, freememorycachepercent=50 as the default seems to be too high (especially when cpu is decoding audio). I don´t understand why, but my experience from testing: The more data we have in cache, the more horsepower is needed to play the movie without stuttering. On the Pi, I settled on a few MB cache, freememorycachepercent=5

Slightly offtopic for this PR: When streamed movie have temporary drop in network speed, so that cache is emptied and vq/aq is not entirely full, there is too much cpu cycles spent by the player repeatedly trying to fetch data from an empty cache. The result is too few cpucycles are spent for movie playback and by filecache to fetch new data from network. In this cornercase scenario, regardless of the configured cachesize, the movie stutters. This is not new and it is not caused by this PR. In my personal build I fixed it like this:
http://pastebin.com/FzDKsmfz

bobo1on1
Collaborator

Ouch, why is Sleep(0) used there, using that means you're basically handing off the thread synchronization to the scheduler, which may or may not do a good job.

tompen-

Sleep(0) was already there. I increased to Sleep(50) if cache is almost empty.

Jellyfrog

+50 on this, I'm unable to use xbmc because of the lack of caching for "LAN", since I connect to my sources with VPN + SMB, and the tunnel sometimes drops in speed, the video stops and it says "buffering" for 2 sec, then plays for 10sec then "buffering" again...

Instead of "alwaysforcebuffer" add an option to choose per source to cache or not

Markus Doits doits referenced this pull request
Closed

Networkcache #831

Markus Doits

what's current status for this? any chance to include this in the next cycle?

classicspam

@tompen - I am curious for the Pi whether it is the network communications (i.e. the read throughput) or the memory subsystem (i.e. memcopy function in circularcache) causing the stuttering due to high cpu cycles. Since I do not have a Pi to play with, if you could run the following test - revert OMXPlayer to the state without any changes (i.e. static read rate of the avg. bitrate of the movie) to see if the skipping still occurs which should eliminate network throughput being the issue. This is of course assuming that you copied the changes from DVDPlayer to OMXPlayer...

Either way, possibly having a different default for the Pi may be in order if and/or when OMXPlayer changes are made, however only having 5 percent of free ram as the default across the board would probably be useless for any devices like the ATV2 which is memory limited but can handle a 30-40 MB buffer size (i.e. about 50 percent of the usual free ram) and basically any standard linux, windows, etc. boxes that people have that can handle decent sized buffers...

tompen-

@classicspam

I have done further testing on Raspberry Pi. Sorry for the long post.
Problem I noticed is caused by disk io reads due to low memory condition for Linux.

As you do not have a Raspberry Pi I write this with lots of details:
I used a rev2 Raspberry Pi board with 256MB memory
(128/128 RAM/GPU memory split)
From Linux point of view we have a total of 128MB RAM.

I compiled latest OpenELEC, commit d5bea25.
This includes xbmc commit c2037d1 (23-Oct-2012).

I added this PR 1388, unchanged.
So for this test, as requested, I did not implement changes to OMXPlayer
(In the test I did a few weeks ago, the changes from this PR was implemented also in OMXPlayer.)

My advancedsettings.xml:
true
50

When playing a 1080p x264 movie, the OSD in xbmc displays 37MB cache is used.
This movie has DTS audio and the cpu downmix audio to stereo output.

Without this PR implemented, I know that I can play this movie flawless with average cpu usage of 75%. (DTS audio decoding is not hardware accelerated, so most of cpu usage is to handle audio).

With the above settings. I get around 0.001 fps. Movie is so slow I can easily see individual frame updates. The more I reduce freememorycachepercent, the better my movie playback works.

iostat reports the boot partition is doing huge amount of reads. cpu resources are wasted in io_wait status. On OpenELEC, the boot-partition is mounted readonly. Located in boot-partition is Linux kernel and the / filesystem as a squashfs. All application binaries are there. I do not have a swapfile.

When movie is playing, Linux have so little free RAM that a simple command such as:
cat /proc/meminfo && iostat
gives error message: "fork: Cannot allocate memory"

Below is my guessing/speculation on the cause:
On the Raspberry pi, with freememorycache=50 XBMC takes too much RAM so Linux does not have enough free RAM to keep enough filesystem cache.

I am guessing this PR does the check for available RAM before playback is started. And on a device with only 128MB memory, the startup of OMXplayer also needs RAM. So the 50% actually consumes more than 50% of available memory because the check of how much free memory we have happens sooner than optimal.

I think, for the PI a different default is needed. freememorycachepercent=50 is unusable.

Maybe this PR need not only to limit cache size to a maximum of 1GB as already done. I am thinking it also need to set a minimum cache size of a couple MB. And, the important point from my test, it needs to make sure we leave alone at least xx MB RAM for the OS.

Perhaps it is better to keep cachemembuffersize setting available. My idea: If cachemembuffersize exist, it override the freememorycachepercent. But if cachememorybuffersize does not exist, the freememorycachepercent should be considered. That gives maximum flexibility for the user.

As mentioned in my previous test, on OpenELEC, with my Raspberry Pi I get the best experience with freememorycachepercent=5. That corresponds to about 5MB cache + the vq/aq cache. With this setting iostat reports that linux is not doing any reads from boot partition during movie playback. I have not figured out exactly when problem starts, but I know the problem starts with big cache. With this setting the movie again play flawless for me.

Another idea I have: The network rate-limit maybe can be disabled if movie need to stop playback and do buffering and also if user have paused the movie. For people with really bad wireless networks and lots of RAM, I guess they will start movie, pause it and wait for 1GB cache to fill before they start watching movie. For them, an unlimited readrate during paused movie would be really good.

As a final note: I think this PR is for sure a big step in the right direction and should be added to xbmc. It would be very good for people that are streaming movies on wireless networks.

JohnHoek JohnHoek referenced this pull request in xbianonpi/xbian
Closed

Enable netwerk caching redux #1388 on XBian #81

JohnHoek

anybody still working on this? This network cache patch is a good addition to xbmc, especially for not so good bandwich on wireless networks.

classicspam

I am waiting for a Rasberry PI to come in (back-order) to test regarding issues that @tompen was describing to see if I can adjust the code (i.e perhaps a 25 or 50 MB memory reservation before the percentage of free ram is used, or to use cachemembuffersize as a static override, etc). Anyways this PR will not be included in main until at least after Frodo goes live as there is a feature freeze...

XBian

I'm going to try to compile XBMC (for XBian) with this pr.

XBian

@classicspam It would be nice if you posted a sample advancedsettings.xml to make that part 100% clear.

XBian

Getting compilation errors with this pr applied

make[1]: *** No rule to make target `DVDInputStreamFile.o', needed by `DVDInputStreams.a'.  Stop.
make: *** [xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreams.a] Error 2
Markus Doits

compiles fine for me at 914e708

edit, for reference, I use this patch: link to patch

Mike jabbera referenced this pull request in OpenELEC/OpenELEC.tv
Closed

Enable network caching, add xbmc PR #2607 #1536

Jellyfrog

@classicspam Why not add an option to choose per source (ie when you add/edit a source) to cache or not, instead of alwaysforcebuffer?

Also, any news about this?

rbej

Working perfect on Rpi. alwaysforcebuffer=true and freememorycachepercent=5

Koenkk

I doubt if this patch has any use for the raspberry pi as it's using omxplayer and dvdplayer is being patched here..

popcornmix
Collaborator

@Koenkk
This applies fine for Pi. We use all the files changed here.

divadnivip007

Been testing with my friend over Wan for 1 month, with OpenVPN and SMB. Very impressive it works great!!

I noticed that it dosent work with ".iso" files. Is there a workaround for enabling cache on ".iso" files?
I'm using the Branch_SMBUseBufferFinalFrodo and compiled it on Febuary 27.

classicspam classicspam PR 831 Inclusions (credit goes to bobo1on1):
- Use Free Ram Percentage as Buffer Size
- Adjust Read Rate Based On Max Bitrate

Enhancements to PR 831:

- move variables over to advanced settings under <network> section ("alwaysforcebuffer" default false and "freememorycachepercent" default 50% max 80% with hard limit of 1GB and 0 value will force filecache. It also removes "cachemembuffersize" variable as it is no longer needed)

- "alwaysforcebuffer" variable will cache everything run through dvdplayer (i.e. OS network shares, local media, etc) except Optical Media Drives

- Memory buffer is straight percentage of free ram (i.e. if 50% free ram is used ~75% of the 50% will be forward looking buffer and ~25% of the 50% will be back buffer)

- Rate limiting which fixes SMB issues with PR 831 as far as I can tell (1.25 times max bitrate up to 40 MB/s in which case it is throttled to max bitrate)

- ios and linux fixes

Advanced Settings Notes: This PR adds 2 setting under advanced settings and removes the "cachemembuffersize" setting as it is no longer needed. The added settings are as follows:

1. alwaysforcebuffer: This will force everything ran through dvdplayer to be buffered that would not be normal buffered except Optical Media.  This includes SMB, Local Files, OS Network Shares, etc.  The current default is false due to it not really being a help to people who use hardwired connections (as they probably do not need buffering for SMB, etc).

2. "freememorycachepercent": The amount of free memory to use as buffer size.  Please note that of the percentage of free memory used ~75% will be used for forward buffering and ~25% will be used for the back buffer.  The default is 50% which is a good default for memory limted devices such as the atv2.  The max is 80 percent and there is a hard limit of 1GB buffer size irregardless of free ram.  Setting it to 0 will force filecaching (same as the way cachemembuffersize was used)

Merged again
36a8e36
Koenkk

Not working anymore because 2 methods are removed (GetVideoBitrate() and GetAudioBitrate()). This was done in the following comit: https://github.com/xbmc/xbmc/commit/87047e93e02375851505e9d6c420dd1225996bdb#xbmc/cores/dvdplayer/DVDPlayer.h

seddonm1

Hope you can fix this classicspam as I want to recompile my OpenElec with this patch. I have 4gb ram sitting idle while playing and would like to use it - plus it would be really nice to get my x16 fast forward a bit smoother.

slakbmc

Hi classicspam! I need this in Frodo quite desperately. It would be really great if you cound fix it. Many thanks!

edit:\ Actually, if the missing "GetXBitrate()" methods is the problem, why not just change it to "m_dvdPlayerVideo.GetVideoBitrate()" as it's used in DVDPlayer.cpp now in line 3815? Would that work? I only have rudimental knowledge of programming but it seams reasonable to me.

mtisza

I have a fix for the compilation issues around the API change. Short of creating a new pull request, I'm not sure how to request this PR be updated with the fix. So the link to my fork/branch with the fix is mtisza@1f7ef33 If I should create a new pull request, please let me know.

Also I'm unsure is the devs want me to use the GetVideoStreamInfo/GetAudioStreamInfo API instead of calls to m_dvdPlayerAudio.GetAudioBitrate(), which is how I chose to do it. If you want me to change it just ask. I'm not even remotely familiar with the vast code of xbmc, so I took the easy way out for now.

I'm dying to see this PR in master, since I've had very good performance with it on my RPIs.

slakbmc

You can also just compile the latest stable from xbmc.org/download with the original PR by classicspam. That's how I did it successfully. Works very well!

NedScott

@mtisza At this point it might be best to make a new PR.

Also, I suggest we make a thread on the forums for keeping track of those of you who have been testing this, to get some nice feedback collected in one place. Every time we comment on here it sends e-mails out to just about all of XBMC's devs and more, so using the forum and leaving a link on the PR would be good for the devs' sanity :) (and their e-mail boxes).

Looking forward to hopefully getting this in soon!

mtisza

I've created a new pull request #2607 with the updates, and rebased with upstream/master.

Martijn Kaijser

See #3104

Guy Westbrook guydev referenced this pull request from a commit in guydev/guydev_plex-home-theatre_enhancements
Tobias Hieta tru Improve caching
We had a very restrictive cache size and the readrate was pretty
limited. This improves on that, parts of this is borrowed from Pull
Request 1388 on XBMC. xbmc/xbmc#1388
bf9055a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Mar 02, 2013
classicspam classicspam PR 831 Inclusions (credit goes to bobo1on1):
- Use Free Ram Percentage as Buffer Size
- Adjust Read Rate Based On Max Bitrate

Enhancements to PR 831:

- move variables over to advanced settings under <network> section ("alwaysforcebuffer" default false and "freememorycachepercent" default 50% max 80% with hard limit of 1GB and 0 value will force filecache. It also removes "cachemembuffersize" variable as it is no longer needed)

- "alwaysforcebuffer" variable will cache everything run through dvdplayer (i.e. OS network shares, local media, etc) except Optical Media Drives

- Memory buffer is straight percentage of free ram (i.e. if 50% free ram is used ~75% of the 50% will be forward looking buffer and ~25% of the 50% will be back buffer)

- Rate limiting which fixes SMB issues with PR 831 as far as I can tell (1.25 times max bitrate up to 40 MB/s in which case it is throttled to max bitrate)

- ios and linux fixes

Advanced Settings Notes: This PR adds 2 setting under advanced settings and removes the "cachemembuffersize" setting as it is no longer needed. The added settings are as follows:

1. alwaysforcebuffer: This will force everything ran through dvdplayer to be buffered that would not be normal buffered except Optical Media.  This includes SMB, Local Files, OS Network Shares, etc.  The current default is false due to it not really being a help to people who use hardwired connections (as they probably do not need buffering for SMB, etc).

2. "freememorycachepercent": The amount of free memory to use as buffer size.  Please note that of the percentage of free memory used ~75% will be used for forward buffering and ~25% will be used for the back buffer.  The default is 50% which is a good default for memory limted devices such as the atv2.  The max is 80 percent and there is a hard limit of 1GB buffer size irregardless of free ram.  Setting it to 0 will force filecaching (same as the way cachemembuffersize was used)

Merged again
36a8e36
This page is out of date. Refresh to see the latest.
9 xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFile.cpp
@@ -23,6 +23,7 @@
23 23 #include "filesystem/IFile.h"
24 24 #include "utils/log.h"
25 25 #include "utils/URIUtils.h"
  26 +#include "settings/AdvancedSettings.h"
26 27
27 28 using namespace XFILE;
28 29
@@ -51,8 +52,13 @@ bool CDVDInputStreamFile::Open(const char* strFile, const std::string& content)
51 52 if (!m_pFile)
52 53 return false;
53 54
  55 + unsigned int flags = READ_TRUNCATED | READ_BITRATE | READ_CHUNKED;
  56 +
  57 + if (!URIUtils::IsOnDVD(strFile) && !URIUtils::IsBluray(strFile) && g_advancedSettings.m_alwaysForceBuffer)
  58 + flags |= READ_CACHED;
  59 +
54 60 // open file in binary mode
55   - if (!m_pFile->Open(strFile, READ_TRUNCATED | READ_BITRATE | READ_CHUNKED))
  61 + if (!m_pFile->Open(strFile, flags))
56 62 {
57 63 delete m_pFile;
58 64 m_pFile = NULL;
@@ -144,6 +150,7 @@ int CDVDInputStreamFile::GetBlockSize()
144 150 void CDVDInputStreamFile::SetReadRate(unsigned rate)
145 151 {
146 152 unsigned maxrate = rate + 1024 * 1024 / 8;
  153 + CLog::Log(LOGDEBUG, "CDVDInputStreamFile::SetReadRate - Read rate set to %u bytes per second", maxrate);
147 154 if(m_pFile->IoControl(IOCTRL_CACHE_SETRATE, &maxrate) >= 0)
148 155 CLog::Log(LOGDEBUG, "CDVDInputStreamFile::SetReadRate - set cache throttle rate to %u bytes per second", maxrate);
149 156 }
26 xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -420,6 +420,7 @@ CDVDPlayer::CDVDPlayer(IPlayerCallback& callback)
420 420 m_offset_pts = 0.0;
421 421 m_playSpeed = DVD_PLAYSPEED_NORMAL;
422 422 m_caching = CACHESTATE_DONE;
  423 + m_readrate = 0;
423 424
424 425 memset(&m_SpeedState, 0, sizeof(m_SpeedState));
425 426
@@ -677,7 +678,11 @@ bool CDVDPlayer::OpenDemuxStream()
677 678 int64_t len = m_pInputStream->GetLength();
678 679 int64_t tim = m_pDemuxer->GetStreamLength();
679 680 if(len > 0 && tim > 0)
680   - m_pInputStream->SetReadRate(len * 1000 / tim);
  681 + {
  682 + //cap to intital read rate to 40 megabits/second if less than average bitrate * 1.25
  683 + m_readrate = std::min((unsigned int)((len * 1000 / tim) * 1.25), (unsigned int) (40000000 / 8));
  684 + m_pInputStream->SetReadRate(m_readrate);
  685 + }
681 686
682 687 return true;
683 688 }
@@ -1081,7 +1086,10 @@ void CDVDPlayer::Process()
1081 1086
1082 1087 // update application with our state
1083 1088 UpdateApplication(1000);
1084   -
  1089 +
  1090 + //update readrate based on peak bitrate
  1091 + UpdateReadRate();
  1092 +
1085 1093 if (CheckDelayedChannelEntry())
1086 1094 continue;
1087 1095
@@ -4020,6 +4028,20 @@ void CDVDPlayer::UpdateApplication(double timeout)
4020 4028 m_UpdateApplication = CDVDClock::GetAbsoluteClock();
4021 4029 }
4022 4030
  4031 +void CDVDPlayer::UpdateReadRate()
  4032 +{
  4033 + unsigned int bytespersecond = (GetVideoBitrate() + GetAudioBitrate()) / 8;
  4034 +
  4035 + if (bytespersecond > m_readrate)
  4036 + {
  4037 + //if current bitrate * 1.25 is over 40 Mbs then cap at at max of actual bitrate or 40 Mb/s whichever is greater
  4038 + //otherwise set read rate to current bitrate * 1.25
  4039 + m_readrate = std::min((unsigned int)(bytespersecond * 1.25), std::max((unsigned int) bytespersecond, (unsigned int) (40000000 / 8)));
  4040 +
  4041 + m_pInputStream->SetReadRate(m_readrate);
  4042 + }
  4043 +}
  4044 +
4023 4045 bool CDVDPlayer::CanRecord()
4024 4046 {
4025 4047 CSingleLock lock(m_StateSection);
3  xbmc/cores/dvdplayer/DVDPlayer.h
@@ -340,6 +340,7 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer
340 340
341 341 void UpdateApplication(double timeout);
342 342 void UpdatePlayState(double timeout);
  343 + void UpdateReadRate();
343 344 double m_UpdateApplication;
344 345
345 346 bool m_bAbortRequest;
@@ -349,7 +350,7 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer
349 350 ECacheState m_caching;
350 351 CFileItem m_item;
351 352 unsigned int m_iChannelEntryTimeOut;
352   -
  353 + unsigned int m_readrate;
353 354
354 355 CCurrentStream m_CurrentAudio;
355 356 CCurrentStream m_CurrentVideo;
23 xbmc/filesystem/FileCache.cpp
@@ -18,6 +18,7 @@
18 18 *
19 19 */
20 20
  21 +#include <limits.h>
21 22 #include "threads/SystemClock.h"
22 23 #include "utils/AutoPtrHandle.h"
23 24 #include "FileCache.h"
@@ -85,11 +86,27 @@ CFileCache::CFileCache() : CThread("CFileCache")
85 86 m_seekPos = 0;
86 87 m_readPos = 0;
87 88 m_writePos = 0;
88   - if (g_advancedSettings.m_cacheMemBufferSize == 0)
  89 + if (g_advancedSettings.m_freeMemCachePercent == 0)
89 90 m_pCache = new CSimpleFileCache();
90 91 else
91   - m_pCache = new CCircularCache(g_advancedSettings.m_cacheMemBufferSize
92   - , std::max<unsigned int>( g_advancedSettings.m_cacheMemBufferSize / 4, 1024 * 1024));
  92 + {
  93 + //set cache size of m_freeMemCachePercent of free ram, with hardcoded 1 GB upper limit
  94 + MEMORYSTATUSEX stat;
  95 + stat.dwLength = sizeof(MEMORYSTATUSEX);
  96 + GlobalMemoryStatusEx(&stat);
  97 +
  98 + //limit max cache to 1 GB
  99 + unsigned int maxcache = (1024 * 1024 * 1000);
  100 + double ramamount = (stat.ullAvailPhys * (g_advancedSettings.m_freeMemCachePercent / 100.00));
  101 +
  102 + unsigned int cacheRam = std::min(static_cast<unsigned int>(ramamount), maxcache);
  103 +
  104 + unsigned int frontCache = static_cast<unsigned int>(cacheRam * 0.75);
  105 + unsigned int backCache = cacheRam - frontCache;
  106 +
  107 + m_pCache = new CCircularCache(frontCache, std::max<unsigned int>(backCache, 1024 * 1024));
  108 + }
  109 +
93 110 m_seekPossible = 0;
94 111 m_cacheFull = false;
95 112 }
6 xbmc/filesystem/MemBufferCache.cpp
@@ -38,9 +38,9 @@ MemBufferCache::MemBufferCache()
38 38 : CCacheStrategy()
39 39 {
40 40 m_nStartPosition = 0;
41   - m_buffer.Create(g_advancedSettings.m_cacheMemBufferSize + 1);
42   - m_HistoryBuffer.Create(g_advancedSettings.m_cacheMemBufferSize + 1);
43   - m_forwardBuffer.Create(g_advancedSettings.m_cacheMemBufferSize + 1);
  41 + m_buffer.Create((1024 * 1024 * 10) + 1);
  42 + m_HistoryBuffer.Create((1024 * 1024 * 10) + 1);
  43 + m_forwardBuffer.Create((1024 * 1024 * 10) + 1);
44 44 }
45 45
46 46
6 xbmc/settings/AdvancedSettings.cpp
@@ -297,7 +297,8 @@ void CAdvancedSettings::Initialize()
297 297
298 298 m_measureRefreshrate = false;
299 299
300   - m_cacheMemBufferSize = 1024 * 1024 * 20;
  300 + m_alwaysForceBuffer = false;
  301 + m_freeMemCachePercent = 50;
301 302 m_addonPackageFolderSize = 200;
302 303
303 304 m_jsonOutputCompact = true;
@@ -676,11 +677,12 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file)
676 677 pElement = pRootElement->FirstChildElement("network");
677 678 if (pElement)
678 679 {
  680 + XMLUtils::GetBoolean(pElement, "alwaysforcebuffer", m_alwaysForceBuffer);
679 681 XMLUtils::GetInt(pElement, "curlclienttimeout", m_curlconnecttimeout, 1, 1000);
680 682 XMLUtils::GetInt(pElement, "curllowspeedtime", m_curllowspeedtime, 1, 1000);
681 683 XMLUtils::GetInt(pElement, "curlretries", m_curlretries, 0, 10);
682 684 XMLUtils::GetBoolean(pElement,"disableipv6", m_curlDisableIPV6);
683   - XMLUtils::GetUInt(pElement, "cachemembuffersize", m_cacheMemBufferSize);
  685 + XMLUtils::GetInt(pElement, "freememorycachepercent", m_freeMemCachePercent, 0, 80);
684 686 }
685 687
686 688 pElement = pRootElement->FirstChildElement("jsonrpc");
3  xbmc/settings/AdvancedSettings.h
@@ -348,7 +348,8 @@ class CAdvancedSettings
348 348 int m_guiDirtyRegionNoFlipTimeout;
349 349 unsigned int m_addonPackageFolderSize;
350 350
351   - unsigned int m_cacheMemBufferSize;
  351 + bool m_alwaysForceBuffer;
  352 + int m_freeMemCachePercent;
352 353
353 354 bool m_jsonOutputCompact;
354 355 unsigned int m_jsonTcpPort;

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.