1
0
mirror of https://github.com/danog/libtgvoip.git synced 2024-11-30 04:39:03 +01:00

More backwards compatibility fixes

This commit is contained in:
Daniil Gentili 2020-03-28 18:41:39 +01:00
parent 0dc1e6c96d
commit 84c16ebcb4
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 14 additions and 3 deletions

View File

@ -376,6 +376,7 @@ void VoIPController::ProcessExtraData(const Wrapped<Extra> &_data, Endpoint &src
for (const auto &stream : outgoingStreams)
{
if (ver.isNew() || stream->type == StreamType::Audio)
ack->streams.v.push_back(stream->getStreamInfo());
}
@ -422,6 +423,10 @@ void VoIPController::ProcessExtraData(const Wrapped<Extra> &_data, Endpoint &src
}
LOGI("peer version from init ack %d", ver.peerVersion);
if (!ver.isNew())
{
incomingStreams.push_back(std::make_shared<IncomingStream>(StreamId::Signaling, StreamType::Signaling));
}
shared_ptr<IncomingAudioStream> incomingAudioStream;
for (const auto &stmInfo : data.streams)

View File

@ -22,7 +22,7 @@ struct Extra : public Serializable, MultiChoice<Extra>
void choose(BufferOutputStream &out, const VersionInfo &ver) const override;
std::string print() const override;
virtual std::string print() const override;
uint64_t hash;
@ -91,7 +91,7 @@ public:
std::string print() const override
{
std::stringstream ss;
ss << "StreamInfo id=" << streamId << ", type=" << type << ", codec=" << codec.print() << ", frameDuration=" << frameDuration << ", enabled=" << enabled;
ss << "StreamInfo id=" << (int)streamId << ", type=" << type << ", codec=" << codec.print() << ", frameDuration=" << frameDuration << ", enabled=" << enabled;
return ss.str();
}
@ -325,6 +325,12 @@ struct ExtraInitAck : public Extra
}
static const uint8_t ID = 9;
std::string print() const override
{
std::stringstream s;
s << "ExtraInitAck (peerVersion=" << peerVersion << ", minVersion=" << minVersion << ", streams: " << streams.print() << ")";
return s.str();
}
size_t getConstructorSize(const VersionInfo &ver) const override
{
return sizeof(peerVersion) + sizeof(minVersion) + streams.getSize(ver);