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

Commit 1570e580 authored by Marco Nelissen's avatar Marco Nelissen Committed by android-build-merger
Browse files

Merge "Fix issues with extractor dumpsys" am: 24cd6995 am: 579955d0 am: 7944a0a5

am: d84aee8f

Change-Id: I32e46905233c052dbc846241f5bfe33399d360f8
parents 26a586c2 d84aee8f
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -200,13 +200,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;
}

@@ -223,9 +228,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;
        }
    }