gst-rtsp-server: Fix leak in appsrc2 example
authorMichael Gruner <michael.gruner@ridgerun.com>
Thu, 20 Jan 2022 23:13:36 +0000 (17:13 -0600)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 24 Jan 2022 01:25:57 +0000 (01:25 +0000)
commit49eba42e081aba1f4361ec6b3de47bdd139ebfec
treee51a21885ff9a37ce1fe0caf777d9c12a7ef91a6
parent64085c20b4b20aeb0957ae5a0ba51206248913f1
gst-rtsp-server: Fix leak in appsrc2 example

In the need-data appsrc callback, a buffer is pulled from the
appsink. This buffer is then copied so that metadata is writable.
The copy is pushed to the appsrc but it doesn't take ownership
of the buffer so we need to manually unref it. The original buffer
is finally unreffed when the sample is freed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1548>
subprojects/gst-rtsp-server/examples/test-appsrc2.c