From 4c125ccacd874f5c68851184e2d6f965087b5df0 Mon Sep 17 00:00:00 2001 From: Pawel Dziepak Date: Thu, 12 Dec 2013 03:00:18 +0100 Subject: [PATCH] kits/media: CPU clock speed may vary significantly --- src/kits/media/MediaRoster.cpp | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/kits/media/MediaRoster.cpp b/src/kits/media/MediaRoster.cpp index 5c0721e40b..78f8d1ce28 100644 --- a/src/kits/media/MediaRoster.cpp +++ b/src/kits/media/MediaRoster.cpp @@ -3112,25 +3112,10 @@ BMediaRoster::AudioBufferSizeFor(int32 channelCount, uint32 sampleFormat, bigtime_t bufferDuration; ssize_t bufferSize; - system_info info; - get_system_info(&info); - - if (info.cpu_clock_speed > 2000000000) // 2 GHz - bufferDuration = 2500; - else if (info.cpu_clock_speed > 1000000000) - bufferDuration = 5000; - else if (info.cpu_clock_speed > 600000000) - bufferDuration = 10000; - else if (info.cpu_clock_speed > 200000000) - bufferDuration = 20000; - else if (info.cpu_clock_speed > 100000000) - bufferDuration = 30000; - else - bufferDuration = 50000; - - if ((busKind == B_ISA_BUS || busKind == B_PCMCIA_BUS) - && bufferDuration < 25000) + if (busKind == B_ISA_BUS || busKind == B_PCMCIA_BUS) bufferDuration = 25000; + else + bufferDuration = 10000; bufferSize = (sampleFormat & 0xf) * channelCount * (ssize_t)((frameRate * bufferDuration) / 1000000.0);