Loading media/libstagefright/rtsp/AAMRAssembler.cpp +10 −6 Original line number Diff line number Diff line Loading @@ -79,13 +79,17 @@ ARTPAssembler::AssemblyStatus AAMRAssembler::assembleMore( } static size_t getFrameSize(bool isWide, unsigned FT) { static const size_t kFrameSizeNB[8] = { 95, 103, 118, 134, 148, 159, 204, 244 static const size_t kFrameSizeNB[9] = { 95, 103, 118, 134, 148, 159, 204, 244, 39 }; static const size_t kFrameSizeWB[9] = { 132, 177, 253, 285, 317, 365, 397, 461, 477 static const size_t kFrameSizeWB[10] = { 132, 177, 253, 285, 317, 365, 397, 461, 477, 40 }; if (FT == 15) { return 1; } size_t frameSize = isWide ? kFrameSizeWB[FT] : kFrameSizeNB[FT]; // Round up bits to bytes and add 1 for the header byte. Loading Loading @@ -161,8 +165,8 @@ ARTPAssembler::AssemblyStatus AAMRAssembler::addPacket( unsigned FT = (toc >> 3) & 0x0f; if ((toc & 3) != 0 || (mIsWide && FT > 8) || (!mIsWide && FT > 7)) { || (mIsWide && FT > 9 && FT != 15) || (!mIsWide && FT > 8 && FT != 15)) { queue->erase(queue->begin()); ++mNextExpectedSeqNo; Loading media/libstagefright/rtsp/ARTSPConnection.cpp +21 −3 Original line number Diff line number Diff line Loading @@ -659,6 +659,7 @@ bool ARTSPConnection::receiveRTSPReponse() { } AString line; ssize_t lastDictIndex = -1; for (;;) { if (!receiveLine(&line)) { break; Loading @@ -668,7 +669,21 @@ bool ARTSPConnection::receiveRTSPReponse() { break; } ALOGV("line: %s", line.c_str()); ALOGV("line: '%s'", line.c_str()); if (line.c_str()[0] == ' ' || line.c_str()[0] == '\t') { // Support for folded header values. if (lastDictIndex < 0) { // First line cannot be a continuation of the previous one. return false; } AString &value = response->mHeaders.editValueAt(lastDictIndex); value.append(line); continue; } ssize_t colonPos = line.find(":"); if (colonPos < 0) { Loading @@ -681,9 +696,12 @@ bool ARTSPConnection::receiveRTSPReponse() { key.tolower(); line.erase(0, colonPos + 1); line.trim(); response->mHeaders.add(key, line); lastDictIndex = response->mHeaders.add(key, line); } for (size_t i = 0; i < response->mHeaders.size(); ++i) { response->mHeaders.editValueAt(i).trim(); } unsigned long contentLength = 0; Loading Loading
media/libstagefright/rtsp/AAMRAssembler.cpp +10 −6 Original line number Diff line number Diff line Loading @@ -79,13 +79,17 @@ ARTPAssembler::AssemblyStatus AAMRAssembler::assembleMore( } static size_t getFrameSize(bool isWide, unsigned FT) { static const size_t kFrameSizeNB[8] = { 95, 103, 118, 134, 148, 159, 204, 244 static const size_t kFrameSizeNB[9] = { 95, 103, 118, 134, 148, 159, 204, 244, 39 }; static const size_t kFrameSizeWB[9] = { 132, 177, 253, 285, 317, 365, 397, 461, 477 static const size_t kFrameSizeWB[10] = { 132, 177, 253, 285, 317, 365, 397, 461, 477, 40 }; if (FT == 15) { return 1; } size_t frameSize = isWide ? kFrameSizeWB[FT] : kFrameSizeNB[FT]; // Round up bits to bytes and add 1 for the header byte. Loading Loading @@ -161,8 +165,8 @@ ARTPAssembler::AssemblyStatus AAMRAssembler::addPacket( unsigned FT = (toc >> 3) & 0x0f; if ((toc & 3) != 0 || (mIsWide && FT > 8) || (!mIsWide && FT > 7)) { || (mIsWide && FT > 9 && FT != 15) || (!mIsWide && FT > 8 && FT != 15)) { queue->erase(queue->begin()); ++mNextExpectedSeqNo; Loading
media/libstagefright/rtsp/ARTSPConnection.cpp +21 −3 Original line number Diff line number Diff line Loading @@ -659,6 +659,7 @@ bool ARTSPConnection::receiveRTSPReponse() { } AString line; ssize_t lastDictIndex = -1; for (;;) { if (!receiveLine(&line)) { break; Loading @@ -668,7 +669,21 @@ bool ARTSPConnection::receiveRTSPReponse() { break; } ALOGV("line: %s", line.c_str()); ALOGV("line: '%s'", line.c_str()); if (line.c_str()[0] == ' ' || line.c_str()[0] == '\t') { // Support for folded header values. if (lastDictIndex < 0) { // First line cannot be a continuation of the previous one. return false; } AString &value = response->mHeaders.editValueAt(lastDictIndex); value.append(line); continue; } ssize_t colonPos = line.find(":"); if (colonPos < 0) { Loading @@ -681,9 +696,12 @@ bool ARTSPConnection::receiveRTSPReponse() { key.tolower(); line.erase(0, colonPos + 1); line.trim(); response->mHeaders.add(key, line); lastDictIndex = response->mHeaders.add(key, line); } for (size_t i = 0; i < response->mHeaders.size(); ++i) { response->mHeaders.editValueAt(i).trim(); } unsigned long contentLength = 0; Loading