Improving error message from neteq_rtpplay

If a packet with unknown RTP payload type is inserted, this CL
will make sure that the error message is a little more detailed
and gives a better understadning of what to do.

BUG=2692
R=tina.legrand@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/27909004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7603 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org
2014-11-04 08:53:10 +00:00
parent a663d90ae3
commit b0f4b3da05
4 changed files with 21 additions and 5 deletions

View File

@ -289,8 +289,24 @@ int main(int argc, char* argv[]) {
static_cast<int>(payload_len),
packet->time_ms() * sample_rate_hz / 1000);
if (error != NetEq::kOK) {
std::cerr << "InsertPacket returned error code " << neteq->LastError()
<< std::endl;
if (neteq->LastError() == NetEq::kUnknownRtpPayloadType) {
std::cerr << "RTP Payload type "
<< static_cast<int>(rtp_header.header.payloadType)
<< " is unknown." << std::endl;
std::cerr << "Use --codec_map to view default mapping." << std::endl;
std::cerr << "Use --helpshort for information on how to make custom "
"mappings." << std::endl;
} else {
std::cerr << "InsertPacket returned error code " << neteq->LastError()
<< std::endl;
std::cerr << "Header data:" << std::endl;
std::cerr << " PT = "
<< static_cast<int>(rtp_header.header.payloadType)
<< std::endl;
std::cerr << " SN = " << rtp_header.header.sequenceNumber
<< std::endl;
std::cerr << " TS = " << rtp_header.header.timestamp << std::endl;
}
}
// Get next packet from file.