summaryrefslogtreecommitdiffstats
path: root/pica-client/audiovideocallcontroller.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pica-client/audiovideocallcontroller.cpp')
-rw-r--r--pica-client/audiovideocallcontroller.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/pica-client/audiovideocallcontroller.cpp b/pica-client/audiovideocallcontroller.cpp
index 5f24e73..d367066 100644
--- a/pica-client/audiovideocallcontroller.cpp
+++ b/pica-client/audiovideocallcontroller.cpp
@@ -730,12 +730,16 @@ void AudioVideoCallController::media_transport_changed(QByteArray peer_id, bool
if (peer_id != m_peer_id)
return;
- // Fragments stay datagram sized for the whole call (see
- // startVideoPipeline()); this only lowers the size further, for when the
- // media connection turns out to carry less than was assumed. Direct call,
+ // Over a media connection the datagram is the hard limit and max_payload
+ // is exactly what fits into one, whether that is less than was assumed at
+ // the start of the call (see startVideoPipeline()) or - on a local network
+ // - more. Back on the c2c connection, where a message can carry far more
+ // than any datagram, fragments stay datagram sized so that the media can
+ // move to a datagram again without changing size mid-frame. Direct call,
// not invokeMethod()/QueuedConnection - see the comment in
// stopAudioPipeline(): cam's thread is blocked inside Capture().
- cam->setMaxFragmentSize(qMin((int)max_payload, (int)PICA_MEDIA_SAFE_PAYLOAD));
+ cam->setMaxFragmentSize(direct_udp && max_payload > 0 ? (int)max_payload
+ : (int)PICA_MEDIA_SAFE_PAYLOAD);
if (callwindow)
callwindow->setMediaTransport(direct_udp, ciphersuitename);