From ea8dc0c737bb1b74466101d1fb4c85df40ac5771 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 30 Oct 2021 00:58:55 +0100 Subject: [PATCH] Couple more g_memdup() -> g_memdup2() fixes Fixes deprecation warnings with newer GLib versions. Part-of: --- subprojects/gst-plugins-bad/gst/mpegtsmux/gstatscmux.c | 3 +++ subprojects/gst-plugins-bad/gst/mpegtsmux/gstbasetsmux.c | 5 ++++- subprojects/gst-plugins-bad/gst/mpegtsmux/gstmpegtsmux.c | 3 +++ .../gst-plugins-good/tests/check/elements/rtphdrext-colorspace.c | 8 ++++---- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst/mpegtsmux/gstatscmux.c b/subprojects/gst-plugins-bad/gst/mpegtsmux/gstatscmux.c index f50f5df..88ced1f 100644 --- a/subprojects/gst-plugins-bad/gst/mpegtsmux/gstatscmux.c +++ b/subprojects/gst-plugins-bad/gst/mpegtsmux/gstatscmux.c @@ -20,6 +20,9 @@ * * SPDX-License-Identifier: LGPL-2.0-or-later */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "gstatscmux.h" diff --git a/subprojects/gst-plugins-bad/gst/mpegtsmux/gstbasetsmux.c b/subprojects/gst-plugins-bad/gst/mpegtsmux/gstbasetsmux.c index 844a4ea..cecedbd 100644 --- a/subprojects/gst-plugins-bad/gst/mpegtsmux/gstbasetsmux.c +++ b/subprojects/gst-plugins-bad/gst/mpegtsmux/gstbasetsmux.c @@ -65,6 +65,9 @@ * * SPDX-License-Identifier: MPL-1.1 OR MIT OR LGPL-2.0-or-later */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include @@ -1818,7 +1821,7 @@ handle_scte35_section (GstBaseTsMux * mux, GstEvent * event, GSTTIME_TO_MPEGTIME (gst_event_get_running_time_offset (event)); pts_adjust &= 0x1ffffffff; - section_data = g_memdup (section->data, section->section_length); + section_data = g_memdup2 (section->data, section->section_length); section_data[4] |= pts_adjust >> 32; section_data[5] = pts_adjust >> 24; section_data[6] = pts_adjust >> 16; diff --git a/subprojects/gst-plugins-bad/gst/mpegtsmux/gstmpegtsmux.c b/subprojects/gst-plugins-bad/gst/mpegtsmux/gstmpegtsmux.c index d5515a0..44c952e 100644 --- a/subprojects/gst-plugins-bad/gst/mpegtsmux/gstmpegtsmux.c +++ b/subprojects/gst-plugins-bad/gst/mpegtsmux/gstmpegtsmux.c @@ -76,6 +76,9 @@ * * {{ tests/examples/mpegts/ts-section-writer.c }} */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "gstmpegtsmux.h" #include diff --git a/subprojects/gst-plugins-good/tests/check/elements/rtphdrext-colorspace.c b/subprojects/gst-plugins-good/tests/check/elements/rtphdrext-colorspace.c index 3a65bef..5c08cd3 100644 --- a/subprojects/gst-plugins-good/tests/check/elements/rtphdrext-colorspace.c +++ b/subprojects/gst-plugins-good/tests/check/elements/rtphdrext-colorspace.c @@ -98,8 +98,8 @@ GST_START_TEST (test_rtphdrext_colorspace_onebyte) gst_harness_set_src_caps (h, src_caps); - gst_harness_push (h, gst_buffer_new_wrapped (g_memdup (vp8_payload, - sizeof (vp8_payload)), sizeof (vp8_payload))); + gst_harness_push (h, + gst_buffer_new_memdup (vp8_payload, sizeof (vp8_payload))); /* verify depayloader correctly reconstructs colorspace information in * its srccaps. */ @@ -192,8 +192,8 @@ GST_START_TEST (test_rtphdrext_colorspace_twobyte) gst_harness_set_src_caps (h, src_caps); - gst_harness_push (h, gst_buffer_new_wrapped (g_memdup (vp8_payload, - sizeof (vp8_payload)), sizeof (vp8_payload))); + gst_harness_push (h, + gst_buffer_new_memdup (vp8_payload, sizeof (vp8_payload))); /* verify depayloader correctly reconstructs colorspace information in * its srccaps. */ -- 2.7.4