diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2006-09-22 15:15:13 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2006-09-22 15:15:13 +0000 |
commit | 25a44f8e02457e811a979b982997fdc01b218e96 (patch) | |
tree | 11b0f5c42caf9d805b7b2ab6815b1f5705b8ca07 /gst/rtp/gstrtpvorbisdepay.c | |
parent | e4ba5018559d09e153aafca1d1d52d9e1cced648 (diff) |
gst/rtp/: More fixage, set endoder-params correctly in the payloader.
Original commit message from CVS:
* gst/rtp/Makefile.am:
* gst/rtp/gstrtp.c: (plugin_init):
* gst/rtp/gstrtpvorbisdepay.c: (gst_rtp_vorbis_depay_process):
* gst/rtp/gstrtpvorbispay.c: (gst_rtp_vorbis_pay_setcaps),
(gst_rtp_vorbis_pay_reset_packet),
(gst_rtp_vorbis_pay_init_packet),
(gst_rtp_vorbis_pay_flush_packet), (gst_rtp_vorbis_pay_parse_id),
(gst_rtp_vorbis_pay_handle_buffer):
More fixage, set endoder-params correctly in the payloader.
Diffstat (limited to 'gst/rtp/gstrtpvorbisdepay.c')
-rw-r--r-- | gst/rtp/gstrtpvorbisdepay.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gst/rtp/gstrtpvorbisdepay.c b/gst/rtp/gstrtpvorbisdepay.c index cf3c0823..551db598 100644 --- a/gst/rtp/gstrtpvorbisdepay.c +++ b/gst/rtp/gstrtpvorbisdepay.c @@ -201,7 +201,7 @@ gst_rtp_vorbis_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) GST_DEBUG_OBJECT (depayload, "got RTP packet of size %d", payload_len); /* we need at least 4 bytes for the packet header */ - if (payload_len < 4) + if (G_UNLIKELY (payload_len < 4)) goto packet_short; payload = gst_rtp_buffer_get_payload (buf); @@ -220,7 +220,7 @@ gst_rtp_vorbis_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) * pkts: number of packets. */ VDT = (header & 0x30) >> 4; - if (VDT == 3) + if (G_UNLIKELY (VDT == 3)) goto ignore_reserved; ident = (header >> 8) & 0xffffff; @@ -235,8 +235,8 @@ gst_rtp_vorbis_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) payload += 4; payload_len -= 4; - GST_DEBUG_OBJECT (depayload, "ident: %u, F: %d, packets: %d", ident, F, - packets); + GST_DEBUG_OBJECT (depayload, "ident: %u, F: %d, VDT: %d, packets: %d", ident, + F, VDT, packets); /* fragmented packets, assemble */ if (F != 0) { @@ -268,6 +268,7 @@ gst_rtp_vorbis_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) /* construct assembled buffer */ payload_len = gst_adapter_available (rtpvorbisdepay->adapter); payload = gst_adapter_take (rtpvorbisdepay->adapter, payload_len); + /* fix the length */ payload[0] = ((payload_len - 2) >> 8) & 0xff; payload[1] = (payload_len - 2) & 0xff; to_free = payload; @@ -307,11 +308,11 @@ gst_rtp_vorbis_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) payload_len); /* skip packet if something odd happens */ - if (length > payload_len) + if (G_UNLIKELY (length > payload_len)) goto length_short; /* create buffer for packet */ - if (to_free) { + if (G_UNLIKELY (to_free)) { outbuf = gst_buffer_new (); GST_BUFFER_DATA (outbuf) = payload; GST_BUFFER_MALLOCDATA (outbuf) = to_free; |