Skip to content

rtsp-media: Ensure the bus watch is removed during unprepare

It's possible for the destruction of the source to be delayed. Instead of relying on the dispose() to remove the bus watch, do it ourselves.

0:00:00.068909422 20865 0x55eb6476db90 DEBUG              rtspmedia rtsp-media.c:4037:finish_unprepare: destroy source
0:00:00.068918345 20865 0x55eb6476db90 DEBUG              rtspmedia rtsp-media.c:4042:finish_unprepare: stop thread
0:00:00.068954189 20865 0x55eb6476db90 DEBUG         rtspthreadpool rtsp-thread-pool.c:481:default_get_thread:<GstRTSPThreadPool@0x55eb64889e10> make new media thread
0:00:00.068975357 20865 0x55eb6476db90 DEBUG         rtspthreadpool rtsp-thread-pool.c:425:make_thread:<GstRTSPThreadPool@0x55eb64889e10> new thread 0x55eb648a3ac0
0:00:00.069042186 20865 0x55eb6476db90 INFO               rtspmedia rtsp-media.c:3884:gst_rtsp_media_prepare: preparing media 0x55eb64890210
0:00:00.069050092 20865 0x55eb6476db90 DEBUG              rtspmedia rtsp-media.c:2792:gst_rtsp_media_set_status: setting new status to 2
0:00:00.069066099 20865 0x55eb6476db90 DEBUG                GST_BUS gstbus.c:256:gst_bus_init:<GstBus@0x55eb6488f290> created
0:00:00.069109067 20865 0x55eb6476db90 DEBUG                GST_BUS gstelement.c:3495:gst_element_get_bus:<media-pipeline> got bus <bus2>
0:00:00.069119436 20865 0x55eb6476db90 ERROR                GST_BUS gstbus.c:887:gst_bus_create_watch_unlocked:<bus2> Tried to add new GSource while one was already there
0:00:00.069165157 20865 0x55eb64894aa0 INFO          rtspthreadpool rtsp-thread-pool.c:329:do_loop: enter mainloop of thread 0x55eb648a3ac0
Unexpected critical/warning: g_source_set_callback: assertion 'source != NULL' failed
0:00:00.069447632 20865 0x55eb646d9aa0 LOG                  GST_BUS gstbus.c:537:gst_bus_timed_pop_filtered:<bus2> have 0 messages
0:00:00.069462796 20865 0x55eb646d9aa0 DEBUG              rtspmedia rtsp-media.c:3382:watch_destroyed:<GstRTSPMedia@0x55eb64890210> source destroyed
0:00:00.069471947 20865 0x55eb646d9aa0 DEBUG                GST_BUS gstbus.c:846:gst_bus_source_dispose:<bus2> disposing source 0x55eb648a6c50
0:00:00.069491138 20865 0x55eb646d9aa0 INFO          rtspthreadpool rtsp-thread-pool.c:331:do_loop: exit mainloop of thread 0x55eb64889e50

Merge request reports