Fix gcc warnings triggered by -Wextra.
TEST=build and audio_coding_unittests and audio_coding_module_test on Linux Review URL: https://webrtc-codereview.appspot.com/343010 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1445 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -198,14 +198,15 @@ bool Receiver::IncomingPacket() {
|
|||||||
_firstTime = false;
|
_firstTime = false;
|
||||||
_realPayloadSizeBytes = _rtpStream->Read(&_rtpInfo, _incomingPayload,
|
_realPayloadSizeBytes = _rtpStream->Read(&_rtpInfo, _incomingPayload,
|
||||||
_payloadSizeBytes, &_nextTime);
|
_payloadSizeBytes, &_nextTime);
|
||||||
if (_realPayloadSizeBytes < 0) {
|
if (_realPayloadSizeBytes == 0) {
|
||||||
printf("Error in reading incoming payload.\n");
|
if (_rtpStream->EndOfFile()) {
|
||||||
return false;
|
_firstTime = true;
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
printf("Error in reading incoming payload.\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (_realPayloadSizeBytes == 0 && _rtpStream->EndOfFile()) {
|
|
||||||
_firstTime = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ok = _acm->IncomingPacket(_incomingPayload,
|
WebRtc_Word32 ok = _acm->IncomingPacket(_incomingPayload,
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ RTPBuffer::Write(const WebRtc_UWord8 payloadType, const WebRtc_UWord32 timeStamp
|
|||||||
|
|
||||||
WebRtc_UWord16
|
WebRtc_UWord16
|
||||||
RTPBuffer::Read(WebRtcRTPHeader* rtpInfo,
|
RTPBuffer::Read(WebRtcRTPHeader* rtpInfo,
|
||||||
WebRtc_Word8* payloadData,
|
WebRtc_Word8* payloadData,
|
||||||
WebRtc_UWord16 payloadSize,
|
WebRtc_UWord16 payloadSize,
|
||||||
WebRtc_UWord32* offset)
|
WebRtc_UWord32* offset)
|
||||||
{
|
{
|
||||||
@@ -125,7 +125,7 @@ RTPBuffer::Read(WebRtcRTPHeader* rtpInfo,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return -1;
|
return 0;
|
||||||
}
|
}
|
||||||
*offset = (packet->timeStamp/(packet->frequency/1000));
|
*offset = (packet->timeStamp/(packet->frequency/1000));
|
||||||
|
|
||||||
@@ -248,11 +248,11 @@ WebRtc_UWord16 RTPFile::Read(WebRtcRTPHeader* rtpInfo,
|
|||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
lengthBytes -= 20;
|
if (lengthBytes < 20)
|
||||||
if (lengthBytes < 0)
|
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
lengthBytes -= 20;
|
||||||
EXPECT_EQ(lengthBytes, fread(payloadData, 1, lengthBytes, _rtpFile));
|
EXPECT_EQ(lengthBytes, fread(payloadData, 1, lengthBytes, _rtpFile));
|
||||||
return lengthBytes;
|
return lengthBytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,12 +24,15 @@ class RTPStream
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~RTPStream(){}
|
virtual ~RTPStream(){}
|
||||||
|
|
||||||
virtual void Write(const WebRtc_UWord8 payloadType, const WebRtc_UWord32 timeStamp,
|
virtual void Write(const WebRtc_UWord8 payloadType, const WebRtc_UWord32 timeStamp,
|
||||||
const WebRtc_Word16 seqNo, const WebRtc_UWord8* payloadData,
|
const WebRtc_Word16 seqNo, const WebRtc_UWord8* payloadData,
|
||||||
const WebRtc_UWord16 payloadSize, WebRtc_UWord32 frequency) = 0;
|
const WebRtc_UWord16 payloadSize, WebRtc_UWord32 frequency) = 0;
|
||||||
|
|
||||||
|
// Returns the packet's payload size. Zero should be treated as an
|
||||||
|
// end-of-stream (in the case that EndOfFile() is true) or an error.
|
||||||
virtual WebRtc_UWord16 Read(WebRtcRTPHeader* rtpInfo,
|
virtual WebRtc_UWord16 Read(WebRtcRTPHeader* rtpInfo,
|
||||||
WebRtc_Word8* payloadData,
|
WebRtc_Word8* payloadData,
|
||||||
WebRtc_UWord16 payloadSize,
|
WebRtc_UWord16 payloadSize,
|
||||||
WebRtc_UWord32* offset) = 0;
|
WebRtc_UWord32* offset) = 0;
|
||||||
virtual bool EndOfFile() const = 0;
|
virtual bool EndOfFile() const = 0;
|
||||||
@@ -65,7 +68,7 @@ public:
|
|||||||
const WebRtc_Word16 seqNo, const WebRtc_UWord8* payloadData,
|
const WebRtc_Word16 seqNo, const WebRtc_UWord8* payloadData,
|
||||||
const WebRtc_UWord16 payloadSize, WebRtc_UWord32 frequency);
|
const WebRtc_UWord16 payloadSize, WebRtc_UWord32 frequency);
|
||||||
WebRtc_UWord16 Read(WebRtcRTPHeader* rtpInfo,
|
WebRtc_UWord16 Read(WebRtcRTPHeader* rtpInfo,
|
||||||
WebRtc_Word8* payloadData,
|
WebRtc_Word8* payloadData,
|
||||||
WebRtc_UWord16 payloadSize,
|
WebRtc_UWord16 payloadSize,
|
||||||
WebRtc_UWord32* offset);
|
WebRtc_UWord32* offset);
|
||||||
virtual bool EndOfFile() const;
|
virtual bool EndOfFile() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user