From 55658ad1662ba94d920515ede8df7d76dea6afe1 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Mon, 16 Oct 2023 23:54:20 +0200 Subject: [PATCH] tsmux: Don't memset in pad_stream when writing a PCR packet tsmux_write_ts_header will write a stuffing adaptation field, so we don't need to prefill the buffer. Part-of: --- subprojects/gst-plugins-bad/gst/mpegtsmux/tsmux/tsmux.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst/mpegtsmux/tsmux/tsmux.c b/subprojects/gst-plugins-bad/gst/mpegtsmux/tsmux/tsmux.c index 183b4ba22b..9c42283b2a 100644 --- a/subprojects/gst-plugins-bad/gst/mpegtsmux/tsmux/tsmux.c +++ b/subprojects/gst-plugins-bad/gst/mpegtsmux/tsmux/tsmux.c @@ -1556,8 +1556,6 @@ pad_stream (TsMux * mux, TsMuxStream * stream, gint64 cur_ts) goto done; } - memset (map.data, 0xFF, map.size); - new_pcr = write_new_pcr (mux, stream, get_current_pcr (mux, cur_ts), get_next_pcr (mux, cur_ts)); if (new_pcr != -1) { @@ -1572,6 +1570,7 @@ pad_stream (TsMux * mux, TsMuxStream * stream, gint64 cur_ts) goto done; } tsmux_write_null_ts_header (map.data); + memset (map.data + TSMUX_HEADER_LENGTH, 0xFF, TSMUX_PAYLOAD_LENGTH); } gst_buffer_unmap (buf, &map);