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

Commit 24cd6995 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix issues with extractor dumpsys"

parents ccf56a09 460b7e88
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -209,13 +209,18 @@ String8 ExtractorInstance::toString() const {
    for (size_t i = 0; i < tracks.size(); i++) {
        const String8 desc = trackDescriptions.itemAt(i);
        str.appendFormat("    track {%s} ", desc.string());
        const sp<IMediaSource> source = tracks.itemAt(i).promote();
        wp<IMediaSource> wSource = tracks.itemAt(i);
        if (wSource == NULL) {
            str.append(": null\n");
        } else {
            const sp<IMediaSource> source = wSource.promote();
            if (source == NULL) {
                str.append(": deleted\n");
            } else {
                str.appendFormat(": active\n");
            }
        }
    }
    return str;
}

@@ -232,9 +237,14 @@ void registerMediaSource(
        if (extractor != NULL && extractor == ex) {
            if (instance.tracks.size() > 5) {
                instance.tracks.resize(5);
                instance.trackDescriptions.resize(5);
            }
            instance.tracks.push_front(source);
            instance.trackDescriptions.add(source->getFormat()->toString());
            if (source != NULL) {
                instance.trackDescriptions.push_front(source->getFormat()->toString());
            } else {
                instance.trackDescriptions.push_front(String8::empty());
            }
            break;
        }
    }