summaryrefslogtreecommitdiff
path: root/gst/pcapparse/gstpcapparse.c
diff options
context:
space:
mode:
authorOleksandrKvl <oleksandrdvl@gmail.com>2019-08-13 17:50:33 +0300
committerOleksandrKvl <oleksandrdvl@gmail.com>2019-08-13 18:54:54 +0300
commitf5a3d7b497afb4d363aae07aab8bb96061bdfe3a (patch)
treed28e8ac953981564b905114e20a2fff0c5f7e976 /gst/pcapparse/gstpcapparse.c
parente2e86658f2a7aaf9baa07bf6ff8738d6a528e584 (diff)
downloadgstreamer-plugins-bad-f5a3d7b497afb4d363aae07aab8bb96061bdfe3a.tar.gz
pcapparse: fix DISCONT flag setting
DISCONT flag should be set only for first packet. Fixes #1047.
Diffstat (limited to 'gst/pcapparse/gstpcapparse.c')
-rw-r--r--gst/pcapparse/gstpcapparse.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gst/pcapparse/gstpcapparse.c b/gst/pcapparse/gstpcapparse.c
index 3ea656b2f..8a60cdad6 100644
--- a/gst/pcapparse/gstpcapparse.c
+++ b/gst/pcapparse/gstpcapparse.c
@@ -325,6 +325,7 @@ gst_pcap_parse_reset (GstPcapParse * self)
self->cur_ts = GST_CLOCK_TIME_NONE;
self->base_ts = GST_CLOCK_TIME_NONE;
self->newsegment_sent = FALSE;
+ self->first_packet = TRUE;
gst_adapter_clear (self->adapter);
}
@@ -537,6 +538,15 @@ gst_pcap_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
} else {
out_buf = gst_buffer_new ();
}
+
+ /* only first packet should have DISCONT flag */
+ if (G_LIKELY (!self->first_packet)) {
+ GST_BUFFER_FLAG_UNSET (out_buf, GST_BUFFER_FLAG_DISCONT);
+ } else {
+ GST_BUFFER_FLAG_SET (out_buf, GST_BUFFER_FLAG_DISCONT);
+ self->first_packet = FALSE;
+ }
+
gst_adapter_flush (self->adapter,
self->cur_packet_size - offset - payload_size);