no transcoding if the packet is from a urf peer

unstable
Tom Early 4 years ago
parent 2070e9e537
commit c6ed1f4277

@ -54,16 +54,19 @@ bool CPacketStream::OpenPacketStream(const CDvHeaderPacket &DvHeader, std::share
m_OwnerClient = client; m_OwnerClient = client;
m_LastPacketTime.start(); m_LastPacketTime.start();
#ifdef TRANSCODED_MODULES #ifdef TRANSCODED_MODULES
auto mod = DvHeader.GetRpt2Module(); if (DvHeader.IsLocalOrigin()) // we only need transcoding if the source is local
if (std::string::npos != std::string(TRANSCODED_MODULES).find(mod))
{ {
m_CodecStream = std::unique_ptr<CCodecStream>(new CCodecStream(this, m_uiStreamId, DvHeader.GetCodecIn(), m_TCReader)); auto mod = DvHeader.GetRpt2Module();
return true; if (std::string::npos != std::string(TRANSCODED_MODULES).find(mod))
} {
else m_CodecStream = std::unique_ptr<CCodecStream>(new CCodecStream(this, m_uiStreamId, DvHeader.GetCodecIn(), m_TCReader));
{ return true;
std::cerr << "Could not find module '" << mod << " in the transcoded list, '" << TRANSCODED_MODULES << "'" << std::endl; }
return false; else
{
std::cerr << "Could not find module '" << mod << " in the transcoded list, '" << TRANSCODED_MODULES << "'" << std::endl;
return false;
}
} }
#else #else
return true; return true;

Loading…
Cancel
Save

Powered by TurnKey Linux.