From e025703d316cc72873586a7b3f1b3b478e536f06 Mon Sep 17 00:00:00 2001 From: Vivia Nikolaidou Date: Mon, 31 Jan 2022 16:13:32 +0200 Subject: [PATCH] tsmux: Skip empty buffers They can be created e.g. by aggregator when there is a gap. Such buffers should not be muxed at all. Part-of: --- subprojects/gst-plugins-bad/gst/mpegtsmux/gstbasetsmux.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst/mpegtsmux/gstbasetsmux.c b/subprojects/gst-plugins-bad/gst/mpegtsmux/gstbasetsmux.c index 9adf9a2713..ea1e528dbe 100644 --- a/subprojects/gst-plugins-bad/gst/mpegtsmux/gstbasetsmux.c +++ b/subprojects/gst-plugins-bad/gst/mpegtsmux/gstbasetsmux.c @@ -1335,9 +1335,11 @@ gst_base_ts_mux_aggregate_buffer (GstBaseTsMux * mux, GST_DEBUG_OBJECT (mux, "delta: %d", delta); - stream_data = stream_data_new (buf); - tsmux_stream_add_data (best->stream, stream_data->map_info.data, - stream_data->map_info.size, stream_data, pts, dts, !delta); + if (gst_buffer_get_size (buf) > 0) { + stream_data = stream_data_new (buf); + tsmux_stream_add_data (best->stream, stream_data->map_info.data, + stream_data->map_info.size, stream_data, pts, dts, !delta); + } /* outgoing ts follows ts of PCR program stream */ if (prog->pcr_stream == best->stream) {