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

Commit 8ebd01a4 authored by Tomoharu Kasahara's avatar Tomoharu Kasahara Committed by Marco Nelissen
Browse files

Set bits per sample for FLAC and WAV

Set bits per sample in FLAC/WAV Extractors to be used in
metadataretriever.

Bug: 112986969
Test: Check if bits per sample can be retrieved from FLAC

Change-Id: I87f917c3bba9a7a852010355cadfb7247c5375f6
Merged-In: I87f917c3bba9a7a852010355cadfb7247c5375f6
parent 90a050ec
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -618,6 +618,7 @@ status_t FLACParser::init()
            mTrackMetadata->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_RAW);
            mTrackMetadata->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_RAW);
            mTrackMetadata->setInt32(kKeyChannelCount, getChannels());
            mTrackMetadata->setInt32(kKeyChannelCount, getChannels());
            mTrackMetadata->setInt32(kKeySampleRate, getSampleRate());
            mTrackMetadata->setInt32(kKeySampleRate, getSampleRate());
            mTrackMetadata->setInt32(kKeyBitsPerSample, getBitsPerSample());
            mTrackMetadata->setInt32(kKeyPcmEncoding, kAudioEncodingPcm16bit);
            mTrackMetadata->setInt32(kKeyPcmEncoding, kAudioEncodingPcm16bit);
            // sample rate is non-zero, so division by zero not possible
            // sample rate is non-zero, so division by zero not possible
            mTrackMetadata->setInt64(kKeyDuration,
            mTrackMetadata->setInt64(kKeyDuration,
+1 −0
Original line number Original line Diff line number Diff line
@@ -310,6 +310,7 @@ status_t WAVExtractor::init() {
                mTrackMeta.setInt32(kKeyChannelCount, mNumChannels);
                mTrackMeta.setInt32(kKeyChannelCount, mNumChannels);
                mTrackMeta.setInt32(kKeyChannelMask, mChannelMask);
                mTrackMeta.setInt32(kKeyChannelMask, mChannelMask);
                mTrackMeta.setInt32(kKeySampleRate, mSampleRate);
                mTrackMeta.setInt32(kKeySampleRate, mSampleRate);
                mTrackMeta.setInt32(kKeyBitsPerSample, mBitsPerSample);
                mTrackMeta.setInt32(kKeyPcmEncoding, kAudioEncodingPcm16bit);
                mTrackMeta.setInt32(kKeyPcmEncoding, kAudioEncodingPcm16bit);


                int64_t durationUs = 0;
                int64_t durationUs = 0;