2009-03-03, 18:28
We need more intelligent cache system for XBMC. Currenlty in XBMC that value is fixed ( CACHE_BUFFER_SIZE (1048576 * 5) ) found in CacheMemBuffer.cpp
In Windows Media Player, user is allowed two options:
1) Automatic
2) Enter Number of seconds to buffer
To calculate automatically ( posted by jmarshal ):
If you know the duration and filesize, then you have to keep buffering until time to download the rest of the file is less than the time to play the rest of the file.
The only tricky bit is where you don't know the duration and/or filesize, and in this case, you have to use some sort of moving average of bitrate, plus some suitable safety margin, in order to predict the future. The moving average and the size of the safety margin can be adjusted (upwards) if and when you don't meet the target.
Quite a few requests on Trac address this issue:
http://trac.xbmc.org/ticket/4636
http://trac.xbmc.org/ticket/4519
http://trac.xbmc.org/ticket/3128
http://trac.xbmc.org/ticket/4640
and forum threads:
http://forum.xbmc.org/showthread.php?tid=36225
In Windows Media Player, user is allowed two options:
1) Automatic
2) Enter Number of seconds to buffer
To calculate automatically ( posted by jmarshal ):
If you know the duration and filesize, then you have to keep buffering until time to download the rest of the file is less than the time to play the rest of the file.
The only tricky bit is where you don't know the duration and/or filesize, and in this case, you have to use some sort of moving average of bitrate, plus some suitable safety margin, in order to predict the future. The moving average and the size of the safety margin can be adjusted (upwards) if and when you don't meet the target.
Quite a few requests on Trac address this issue:
http://trac.xbmc.org/ticket/4636
http://trac.xbmc.org/ticket/4519
http://trac.xbmc.org/ticket/3128
http://trac.xbmc.org/ticket/4640
and forum threads:
http://forum.xbmc.org/showthread.php?tid=36225