summaryrefslogtreecommitdiff
path: root/gst/mpegtsmux
diff options
context:
space:
mode:
authorAlex Hoenig <alexander.hoenig@progeny.net>2020-05-12 10:55:45 -0400
committerAlex Hoenig <alexander.hoenig@progeny.net>2020-05-12 12:18:28 -0400
commit0a2e026985d86abe92e24ef546cb81a2e4b7cc10 (patch)
tree22c1942497ab3f078556735111a36a969b2e7be4 /gst/mpegtsmux
parent6dae95d60f273e623cdfcb7ce80e9ee165947e92 (diff)
downloadgstreamer-plugins-bad-0a2e026985d86abe92e24ef546cb81a2e4b7cc10.tar.gz
mpegtsmux: detect and ignore gap buffers
Fixes #1291. Without this, when a stream has gaps and then resumes, the next buffer PTS that is written to the TS is given the PTS of the first gap. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1263>
Diffstat (limited to 'gst/mpegtsmux')
-rw-r--r--gst/mpegtsmux/gstbasetsmux.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gst/mpegtsmux/gstbasetsmux.c b/gst/mpegtsmux/gstbasetsmux.c
index d40d5a66b..a68af9901 100644
--- a/gst/mpegtsmux/gstbasetsmux.c
+++ b/gst/mpegtsmux/gstbasetsmux.c
@@ -1076,6 +1076,12 @@ gst_base_ts_mux_aggregate_buffer (GstBaseTsMux * mux,
GST_DEBUG_OBJECT (mux, "Pads collected");
+ if (buf && gst_buffer_get_size (buf) == 0
+ && GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_GAP)) {
+ gst_buffer_unref (buf);
+ return GST_FLOW_OK;
+ }
+
if (G_UNLIKELY (mux->first)) {
ret = gst_base_ts_mux_create_streams (mux);
if (G_UNLIKELY (ret != GST_FLOW_OK)) {