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

Commit a392aea6 authored by Harish Mahendrakar's avatar Harish Mahendrakar
Browse files

Speed up SniffMidi() by parsing the initial bytes of the header

SniffMidi() was creating a MidiEngine() instance which in turn was
using a WatchDog timer to abort if the operation took longer than
10 seconds. In some cases, SniffMidi() was consuming more than 10 seconds.

This is now optimized by parsing a few initial bytes to identify
different types of midi files.

Bug: 359920208
Test: atest CtsMediaPlayerTestCases \
 CtsMediaExtractorTestCases \
 CtsMediaAudioTestCases:MidiSoloTest \
 CtsMediaAudioTestCases:SoundPoolMidiTest \
 CtsMediaV2TestCases:ExtractorTest \
 CtsMediaV2TestCases:ExtractorUnitTest

Change-Id: Ibf1e922d6de32ab6f2fbd8178843603a9bf72100
parent 2abffc64
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment