mem leak with avdec+appsink while doing multiple state change
Describe your issue
I have written a simple code to use avdec+appsink and performing state change in a loop (for simplicity I am running the stream for 2 sec and changing the state to PAUSED after 2 sec), I can see sw memory is increasing continuously.
Expected Behavior
No mem leak should occur
Observed Behavior
mem leak is observed after every iteration
Setup
Using GStreamer 1.16.3 on Ubuntu 20.04.5
Steps to reproduce the bug
- compile attached "decoder_state_change.cpp" file with:
g++ decoder_state_change.cpp -o decode_sample
pkg-config --cflags --libs gstreamer-1.0 gstreamer-app-1.0
- run: ./decode_sample
- Observe mem leak in different terminal
How reproducible is the bug?
reproducible 100%
Additional Information
I have used one h264 stream, you can use any h264 stream, please change the name of the stream inside the code i.e. in "decoder_state_change.cpp" file, else I can share the file as well if needed. decoder_state_change.cpp