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

Commit d553ef07 authored by Ray Essick's avatar Ray Essick Committed by Automerger Merge Worker
Browse files

Merge "Graceful handling of missing extractor metadata" into sc-dev am: e433c73d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/15178530

Change-Id: Iddca633c4ae0a3dd3d67b8af71ac32569d4748e7
parents cb97ccd6 e433c73d
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -307,8 +307,16 @@ status_t NuMediaExtractor::getFileFormat(sp<AMessage> *format) const {

    sp<MetaData> meta = mImpl->getMetaData();

    if (meta == nullptr) {
        //extractor did not publish file metadata
        return -EINVAL;
    }

    const char *mime;
    CHECK(meta->findCString(kKeyMIMEType, &mime));
    if (!meta->findCString(kKeyMIMEType, &mime)) {
        // no mime type maps to invalid
        return -EINVAL;
    }
    *format = new AMessage();
    (*format)->setString("mime", mime);

@@ -354,6 +362,11 @@ status_t NuMediaExtractor::getExifOffsetSize(off64_t *offset, size_t *size) cons

    sp<MetaData> meta = mImpl->getMetaData();

    if (meta == nullptr) {
        //extractor did not publish file metadata
        return -EINVAL;
    }

    int64_t exifOffset, exifSize;
    if (meta->findInt64(kKeyExifOffset, &exifOffset)
     && meta->findInt64(kKeyExifSize, &exifSize)) {