RTSP media unable to remove bus watch
Since we are using the 1.18.5 version of gstreamer and gst-rtsp-server (we were on 1.17.2 before), we can see a new error log:
ERROR GST_BUS gstbus.c:1087:gst_bus_remove_watch:<bus6> no bus watch was present
Our software runs fine, but this log is annoying and may signify there is something wrong anyway. I looked into the source code and this is due to the code in rtsp_media.c, in function finish_unprepare()
at line 4022:
4016 /* the source has the last ref to the media */
4017 if (priv->source) {
4018 GstBus *bus;
4019
4020 GST_DEBUG ("removing bus watch");
4021 bus = gst_pipeline_get_bus (GST_PIPELINE_CAST (priv->pipeline));
4022 gst_bus_remove_watch (bus);
4023 gst_object_unref (bus);
4024
4025 GST_DEBUG ("destroy source");
4026 g_source_destroy (priv->source);
4027 g_source_unref (priv->source);
4028 priv->source = NULL;
4029 }
The problem seems that the watch has been created using gst_bus_create_watch (bus)
in default_prepare()
function and so is not registered into the bus instance itself so it cannot be removed from the bus (it seems that we should use the gst_bus_add_watch()
or gst_bus_add_signal_watch()
for that)