Loading media/libstagefright/id3/ID3.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -234,9 +234,11 @@ struct id3_header { } // first handle global unsynchronization bool hasGlobalUnsync = false; if (header.flags & 0x80) { ALOGV("removing unsynchronization"); hasGlobalUnsync = true; removeUnsynchronization(); } Loading Loading @@ -341,12 +343,12 @@ struct id3_header { memcpy(copy, mData, size); bool success = removeUnsynchronizationV2_4(false /* iTunesHack */); bool success = removeUnsynchronizationV2_4(false /* iTunesHack */, hasGlobalUnsync); if (!success) { memcpy(mData, copy, size); mSize = size; success = removeUnsynchronizationV2_4(true /* iTunesHack */); success = removeUnsynchronizationV2_4(true /* iTunesHack */, hasGlobalUnsync); if (success) { ALOGV("Had to apply the iTunes hack to parse this ID3 tag"); Loading Loading @@ -407,7 +409,7 @@ static void WriteSyncsafeInteger(uint8_t *dst, size_t x) { } } bool ID3::removeUnsynchronizationV2_4(bool iTunesHack) { bool ID3::removeUnsynchronizationV2_4(bool iTunesHack, bool hasGlobalUnsync) { size_t oldSize = mSize; size_t offset = mFirstFrameOffset; Loading Loading @@ -443,7 +445,7 @@ bool ID3::removeUnsynchronizationV2_4(bool iTunesHack) { flags &= ~1; } if ((flags & 2) && (dataSize >= 2)) { if (!hasGlobalUnsync && (flags & 2) && (dataSize >= 2)) { // This frame has "unsynchronization", so we have to replace occurrences // of 0xff 0x00 with just 0xff in order to get the real data. Loading media/libstagefright/include/ID3.h +1 −1 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ private: bool parseV1(DataSourceBase *source); bool parseV2(DataSourceBase *source, off64_t offset); void removeUnsynchronization(); bool removeUnsynchronizationV2_4(bool iTunesHack); bool removeUnsynchronizationV2_4(bool iTunesHack, bool hasGlobalUnsync); static bool ParseSyncsafeInteger(const uint8_t encoded[4], size_t *x); Loading Loading
media/libstagefright/id3/ID3.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -234,9 +234,11 @@ struct id3_header { } // first handle global unsynchronization bool hasGlobalUnsync = false; if (header.flags & 0x80) { ALOGV("removing unsynchronization"); hasGlobalUnsync = true; removeUnsynchronization(); } Loading Loading @@ -341,12 +343,12 @@ struct id3_header { memcpy(copy, mData, size); bool success = removeUnsynchronizationV2_4(false /* iTunesHack */); bool success = removeUnsynchronizationV2_4(false /* iTunesHack */, hasGlobalUnsync); if (!success) { memcpy(mData, copy, size); mSize = size; success = removeUnsynchronizationV2_4(true /* iTunesHack */); success = removeUnsynchronizationV2_4(true /* iTunesHack */, hasGlobalUnsync); if (success) { ALOGV("Had to apply the iTunes hack to parse this ID3 tag"); Loading Loading @@ -407,7 +409,7 @@ static void WriteSyncsafeInteger(uint8_t *dst, size_t x) { } } bool ID3::removeUnsynchronizationV2_4(bool iTunesHack) { bool ID3::removeUnsynchronizationV2_4(bool iTunesHack, bool hasGlobalUnsync) { size_t oldSize = mSize; size_t offset = mFirstFrameOffset; Loading Loading @@ -443,7 +445,7 @@ bool ID3::removeUnsynchronizationV2_4(bool iTunesHack) { flags &= ~1; } if ((flags & 2) && (dataSize >= 2)) { if (!hasGlobalUnsync && (flags & 2) && (dataSize >= 2)) { // This frame has "unsynchronization", so we have to replace occurrences // of 0xff 0x00 with just 0xff in order to get the real data. Loading
media/libstagefright/include/ID3.h +1 −1 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ private: bool parseV1(DataSourceBase *source); bool parseV2(DataSourceBase *source, off64_t offset); void removeUnsynchronization(); bool removeUnsynchronizationV2_4(bool iTunesHack); bool removeUnsynchronizationV2_4(bool iTunesHack, bool hasGlobalUnsync); static bool ParseSyncsafeInteger(const uint8_t encoded[4], size_t *x); Loading