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

Commit ea405328 authored by Lajos Molnar's avatar Lajos Molnar Committed by Android Git Automerger
Browse files

am c40da54b: Merge "Fix freed memory references" into lmp-dev

* commit 'c40da54b':
  Fix freed memory references
parents 053125b5 c40da54b
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -48,7 +48,8 @@ namespace android {
class MPEG4Source : public MediaSource {
public:
    // Caller retains ownership of both "dataSource" and "sampleTable".
    MPEG4Source(const sp<MetaData> &format,
    MPEG4Source(const sp<MPEG4Extractor> &owner,
                const sp<MetaData> &format,
                const sp<DataSource> &dataSource,
                int32_t timeScale,
                const sp<SampleTable> &sampleTable,
@@ -70,6 +71,8 @@ protected:
private:
    Mutex mLock;

    // keep the MPEG4Extractor around, since we're referencing its data
    sp<MPEG4Extractor> mOwner;
    sp<MetaData> mFormat;
    sp<DataSource> mDataSource;
    int32_t mTimescale;
@@ -2593,7 +2596,7 @@ sp<MediaSource> MPEG4Extractor::getTrack(size_t index) {

    ALOGV("getTrack called, pssh: %zu", mPssh.size());

    return new MPEG4Source(
    return new MPEG4Source(this,
            track->meta, mDataSource, track->timescale, track->sampleTable,
            mSidxEntries, trex, mMoofOffset);
}
@@ -2940,6 +2943,7 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio(
////////////////////////////////////////////////////////////////////////////////

MPEG4Source::MPEG4Source(
        const sp<MPEG4Extractor> &owner,
        const sp<MetaData> &format,
        const sp<DataSource> &dataSource,
        int32_t timeScale,
@@ -2947,7 +2951,8 @@ MPEG4Source::MPEG4Source(
        Vector<SidxEntry> &sidx,
        const Trex *trex,
        off64_t firstMoofOffset)
    : mFormat(format),
    : mOwner(owner),
      mFormat(format),
      mDataSource(dataSource),
      mTimescale(timeScale),
      mSampleTable(sampleTable),