GstPlay is not dropped although all references are dropped in user code.
Describe your issue
We use GstPlay along with the GstGtk4PaintableSink for our video player in Fractal. Sometimes when the video player is dropped, the GstPlay it used still exists.
Expected Behavior
All instances of GstPlay are always dropped when the user code drops them.
Observed Behavior
Some instances of GstPlay seem to persist even if all references are dropped in user code.
Setup
- Operating System: Fedora Silverblue 38
- Device: Computer
- gstreamer-rs Version: 0.21.1
- GStreamer Version: 1.22.6
- Command line: bash
Steps to reproduce the bug
It can be reproduced unreliably by running this project, and constructing/destroying the videos several times: https://gitlab.gnome.org/kcommaille/gst_play_ref.
Since it seems to happen when the app is busy, it helps to load a bigger video or present more videos.
It can be observed in too ways:
- The calls to constructed and dispose are logged, so you can compare the number of calls for both.
- Launch the app with this environment variable set:
GOBJECT_DEBUG=instance-count
; then open the GTK Inspector and watch the count of GstPlay in Global / Statistics. It does not always drop to 0 when the players are destroyed.
How reproducible is the bug?
Intermittent. Like I said it seems to happen when the app is busy. When several video players are shown at once, I could sometimes see that all of them are dropped, some of them, or none of them.
Solutions you have tried
I was wondering if that had anything to do with the media still playing when the player is dropped so I tried setting the URI to None
or stopping the GstPlay on dispose.