diff options
author | OleksandrKvl <oleksandrdvl@gmail.com> | 2019-08-13 17:50:33 +0300 |
---|---|---|
committer | OleksandrKvl <oleksandrdvl@gmail.com> | 2019-08-13 18:54:54 +0300 |
commit | f5a3d7b497afb4d363aae07aab8bb96061bdfe3a (patch) | |
tree | d28e8ac953981564b905114e20a2fff0c5f7e976 /gst | |
parent | e2e86658f2a7aaf9baa07bf6ff8738d6a528e584 (diff) | |
download | gstreamer-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')
-rw-r--r-- | gst/pcapparse/gstpcapparse.c | 10 | ||||
-rw-r--r-- | gst/pcapparse/gstpcapparse.h | 1 |
2 files changed, 11 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); diff --git a/gst/pcapparse/gstpcapparse.h b/gst/pcapparse/gstpcapparse.h index 6fb39a43d..5feb4c661 100644 --- a/gst/pcapparse/gstpcapparse.h +++ b/gst/pcapparse/gstpcapparse.h @@ -85,6 +85,7 @@ struct _GstPcapParse GstPcapParseLinktype linktype; gboolean newsegment_sent; + gboolean first_packet; }; struct _GstPcapParseClass |