diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2015-06-15 23:40:44 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2015-07-03 10:30:22 +0100 |
commit | f17899a55cff8bf7ab61b4fe565d0f8e81a74751 (patch) | |
tree | 501d9d8c9d20903cf8559ce43d0d713a1484fa30 /gst | |
parent | 158f8d5b68795e807c3bc5ede2be0b976762e274 (diff) | |
download | gstreamer-plugins-bad-f17899a55cff8bf7ab61b4fe565d0f8e81a74751.tar.gz |
pcapparse: fix another regression
Introduced by c4c9fe60b pcapparse: Take buffer directly from the adapter
Using gst_adapter_take_buffer_fast() can lead to buffers that are
made up of multiple memories with the first memory smaller than the
RTP header size, which violates assumptions GstRtpBaseDepayloader
makes, namely that the complete RTP header will be in the first
memory. This leads to such packets being dropped when feeding
them from pcapparse to RTP depayloaders. Use take_buffer() so
we get buffers with a single memory.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/pcapparse/gstpcapparse.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gst/pcapparse/gstpcapparse.c b/gst/pcapparse/gstpcapparse.c index 75d4cb92a..fae228607 100644 --- a/gst/pcapparse/gstpcapparse.c +++ b/gst/pcapparse/gstpcapparse.c @@ -482,8 +482,11 @@ gst_pcap_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) gst_adapter_unmap (self->adapter); gst_adapter_flush (self->adapter, offset); - out_buf = gst_adapter_take_buffer_fast (self->adapter, - payload_size); + /* we don't use _take_buffer_fast() on purpose here, we need a + * buffer with a single memory, since the RTP depayloaders expect + * the complete RTP header to be in the first memory if there are + * multiple ones and we can't guarantee that with _fast() */ + out_buf = gst_adapter_take_buffer (self->adapter, payload_size); gst_adapter_flush (self->adapter, self->cur_packet_size - offset - payload_size); |