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

Commit cd742b91 authored by Dongwon Kang's avatar Dongwon Kang Committed by Android (Google) Code Review
Browse files

Merge "Disable detection of MP3 audio contained in MPEG1"

parents ef6cf3fc 24776732
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -678,6 +678,15 @@ static MediaExtractor::CreatorFunc Sniff(
    off64_t pos = 0;
    off64_t post_id3_pos;
    uint32_t header;
    uint8_t mpeg_header[5];
    if (source->readAt(0, mpeg_header, sizeof(mpeg_header)) < (ssize_t)sizeof(mpeg_header)) {
        return NULL;
    }

    if (!memcmp("\x00\x00\x01\xba", mpeg_header, 4) && (mpeg_header[4] >> 4) == 2) {
        ALOGV("MPEG1PS container is not supported!");
        return NULL;
    }
    if (!Resync(source, 0, &pos, &post_id3_pos, &header)) {
        return NULL;
    }