GNOME Bugzilla – Bug 743912
pulse audio sink report server is dead when doing audio track switching
Last modified: 2018-11-03 14:57:23 UTC
This issue is reproduced by switch two audio track with different sample rate repeatly, finally will report:" Error: Disconnected: Bad state" It's from function gst_pulsering_is_dead(). The reason is two threads race condition, when switch two audio track with differnt caps, audio base will set new caps to pulsesink, then two threads will have race condition. The first thread is gst_pulsesink_get_time(), the other is gst_audio_base_sink_setcaps(). In gst_audio_base_sink_setcaps, it will release audio ring buffer, which will finally release pulse audio stream. But in gst_pulsesink_get_time(), it will call gst_pulsering_is_dead() to check if pbuf->stream is still valid, if invalid will report server is dead. So need to check if pa stream is still alive in gst_pulsesink_get_time(). Patch is attached.
Created attachment 295998 [details] [review] patch for fixing this issue
I also found the same issue in GST-1.2.3, this is not regression in GST-1.4.1. Can you help review if this patch is correct?
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/155.