rtpaudiopayload: Only sent exact multiple of the frame size

Also align the maximum size with the frame size, not only the minimum
This commit is contained in:
Olivier Crête 2009-10-21 12:38:59 +03:00
parent e55bf9bdd8
commit e27c24b200

View file

@ -719,8 +719,8 @@ gst_base_rtp_audio_payload_handle_buffer (GstBaseRTPPayload *
/* as long as we have full frames */ /* as long as we have full frames */
while (available >= min_payload_len) { while (available >= min_payload_len) {
/* get multiple of alignment */ /* get multiple of alignment */
payload_len = ALIGN_DOWN (available, align); payload_len = MIN (max_payload_len, available);
payload_len = MIN (max_payload_len, payload_len); payload_len = ALIGN_DOWN (payload_len, align);
/* and flush out the bytes from the adapter, automatically set the /* and flush out the bytes from the adapter, automatically set the
* timestamp. */ * timestamp. */