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

Commit ba1f4816 authored by Andreas Huber's avatar Andreas Huber
Browse files

NPR's audio streams start with a 30sec segment whose mp3 headers are subtly...

NPR's audio streams start with a 30sec segment whose mp3 headers are subtly different from those following. Allow certain bits to vary that were thought to be fixed before.

related-to-bug: 2490385
parent c0170bc6
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -36,8 +36,10 @@
namespace android {
namespace android {


// Everything must match except for
// Everything must match except for
// protection, bitrate, padding, private bits and mode extension.
// protection, bitrate, padding, private bits, mode extension,
static const uint32_t kMask = 0xfffe0ccf;
// copyright bit, original bit and emphasis.
// Yes ... there are things that must indeed match...
static const uint32_t kMask = 0xfffe0cc0;


static bool get_mp3_frame_size(
static bool get_mp3_frame_size(
        uint32_t header, size_t *frame_size,
        uint32_t header, size_t *frame_size,
@@ -669,7 +671,7 @@ status_t MP3Source::read(
        }
        }


        // Lost sync.
        // Lost sync.
        LOGV("lost sync!\n");
        LOGV("lost sync! header = 0x%08x, old header = 0x%08x\n", header, mFixedHeader);


        off_t pos = mCurrentPos;
        off_t pos = mCurrentPos;
        if (!Resync(mDataSource, mFixedHeader, &pos, NULL)) {
        if (!Resync(mDataSource, mFixedHeader, &pos, NULL)) {