mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-29 22:00:16 +08:00
configure audio buffer
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -435,6 +435,26 @@ abstract final class Pref {
|
||||
static double get bufferSec =>
|
||||
_setting.get(SettingBoxKey.bufferSec, defaultValue: 16.0);
|
||||
|
||||
static Map<String, String> initBuffer([double playbackSpeed = 1.0]) {
|
||||
final bufSec = Pref.bufferSec * playbackSpeed;
|
||||
final bufSiz = (Pref.bufferSize * 0x100000).toStringAsFixed(0);
|
||||
return {
|
||||
'cache': 'yes',
|
||||
'cache-secs': bufSec.toStringAsFixed(3),
|
||||
'demuxer-hysteresis-secs': (bufSec / 1.5).toStringAsFixed(3),
|
||||
'demuxer-max-bytes': bufSiz,
|
||||
'demuxer-max-back-bytes': bufSiz,
|
||||
};
|
||||
}
|
||||
|
||||
static Map<String, String> initLiveBuffer() {
|
||||
return {
|
||||
'cache': 'yes',
|
||||
'demuxer-max-bytes': (Pref.bufferSize * 0x200000).toStringAsFixed(0),
|
||||
'demuxer-max-back-bytes': '0',
|
||||
};
|
||||
}
|
||||
|
||||
static String get audioOutput => _setting.get(
|
||||
SettingBoxKey.audioOutput,
|
||||
defaultValue: AudioOutput.defaultValue,
|
||||
|
||||
Reference in New Issue
Block a user