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

Commit c761a965 authored by Shuhei,Miyazaki's avatar Shuhei,Miyazaki Committed by Shuhei Miyazaki
Browse files

Set bit rate infomation to meta for MPEG4Extractor

In order to get bit rate information correctly for offload,
Set Max Bitrate and average bitrate to meta
when MPEG4Extractor is used.

Bug: 66376238
Test: Playback AAC file then check sound.
Change-Id: Ie357c3c94db3ee894333be9659001c46b9ddcef8
parent 69545369
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -3467,6 +3467,18 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio(
        return ERROR_UNSUPPORTED;
    }

    if (mLastTrack != NULL) {
        uint32_t maxBitrate = 0;
        uint32_t avgBitrate = 0;
        esds.getBitRate(&maxBitrate, &avgBitrate);
        if (maxBitrate > 0 && maxBitrate < INT32_MAX) {
            mLastTrack->meta->setInt32(kKeyMaxBitRate, (int32_t)maxBitrate);
        }
        if (avgBitrate > 0 && avgBitrate < INT32_MAX) {
            mLastTrack->meta->setInt32(kKeyBitRate, (int32_t)avgBitrate);
        }
    }

    const uint8_t *csd;
    size_t csd_size;
    if (esds.getCodecSpecificInfo(