Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b858bd85 authored by Dean Wheatley's avatar Dean Wheatley
Browse files

Vary tee sink frame count based on sample rate

Test tee sink of E-AC3 wrapped in IEC61937 at 192kHz and verify that
test vector of duration 15 seconds is able to be tee sinked completely.

Change-Id: I75fc8a636bd5a7961bcea4efd12de12d7fadd05e
parent 2c4386d4
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -199,8 +199,8 @@ private:

            // determine number of frames for Tee
            if (frames == 0) {
                // TODO: consider varying frame count based on type.
                frames = DEFAULT_TEE_FRAMES;
                frames = (static_cast<long long>(DEFAULT_TEE_DURATION_MS) * format.mSampleRate)
                            / MILLIS_PER_SECOND;
            }

            // TODO: should we check minimum number of frames?
@@ -261,8 +261,7 @@ private:
        static NBAIO_SinkSource makeSinkSource(
                const NBAIO_Format &format, size_t frames, bool *enabled);

        // 0x200000 stereo 16-bit PCM frames = 47.5 seconds at 44.1 kHz, 8 megabytes
        static constexpr size_t DEFAULT_TEE_FRAMES = 0x200000;
        static constexpr size_t DEFAULT_TEE_DURATION_MS = 60'000;

        // atomic status checking
        std::atomic<bool> mEnabled{false};