mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-25 01:54:17 +00:00
gst/rtp/gstrtpL16pay.c: Only put an integral amount of samples in the RTP packet.
Original commit message from CVS: * gst/rtp/gstrtpL16pay.c: (gst_rtp_L16_pay_flush), (gst_rtp_L16_pay_getcaps): Only put an integral amount of samples in the RTP packet. Fixes #556641.
This commit is contained in:
parent
b29385bd76
commit
38eac47ec9
2 changed files with 11 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2008-10-29 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
|
* gst/rtp/gstrtpL16pay.c: (gst_rtp_L16_pay_flush),
|
||||||
|
(gst_rtp_L16_pay_getcaps):
|
||||||
|
Only put an integral amount of samples in the RTP packet.
|
||||||
|
Fixes #556641.
|
||||||
|
|
||||||
2008-10-28 Wim Taymans <wim.taymans@collabora.co.uk>
|
2008-10-28 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
* gst/rtp/gstrtpchannels.c: (gst_rtp_channels_get_by_index):
|
* gst/rtp/gstrtpchannels.c: (gst_rtp_channels_get_by_index):
|
||||||
|
|
|
@ -245,6 +245,10 @@ gst_rtp_L16_pay_flush (GstRtpL16Pay * rtpL16pay, guint len)
|
||||||
guint samples;
|
guint samples;
|
||||||
GstClockTime duration;
|
GstClockTime duration;
|
||||||
|
|
||||||
|
/* calculate the amount of samples and round down the length */
|
||||||
|
samples = len / (2 * rtpL16pay->channels);
|
||||||
|
len = samples * (2 * rtpL16pay->channels);
|
||||||
|
|
||||||
/* now alloc output buffer */
|
/* now alloc output buffer */
|
||||||
outbuf = gst_rtp_buffer_new_allocate (len, 0, 0);
|
outbuf = gst_rtp_buffer_new_allocate (len, 0, 0);
|
||||||
|
|
||||||
|
@ -255,7 +259,6 @@ gst_rtp_L16_pay_flush (GstRtpL16Pay * rtpL16pay, guint len)
|
||||||
gst_adapter_copy (rtpL16pay->adapter, payload, 0, len);
|
gst_adapter_copy (rtpL16pay->adapter, payload, 0, len);
|
||||||
gst_adapter_flush (rtpL16pay->adapter, len);
|
gst_adapter_flush (rtpL16pay->adapter, len);
|
||||||
|
|
||||||
samples = len / (2 * rtpL16pay->channels);
|
|
||||||
duration = gst_util_uint64_scale_int (samples, GST_SECOND, rtpL16pay->rate);
|
duration = gst_util_uint64_scale_int (samples, GST_SECOND, rtpL16pay->rate);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = rtpL16pay->first_ts;
|
GST_BUFFER_TIMESTAMP (outbuf) = rtpL16pay->first_ts;
|
||||||
|
@ -348,7 +351,6 @@ gst_rtp_L16_pay_getcaps (GstBaseRTPPayload * rtppayload, GstPad * pad)
|
||||||
}
|
}
|
||||||
gst_caps_unref (otherpadcaps);
|
gst_caps_unref (otherpadcaps);
|
||||||
}
|
}
|
||||||
|
|
||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue