diff --git a/subprojects/gst-plugins-good/sys/osxaudio/gstosxaudiosink.c b/subprojects/gst-plugins-good/sys/osxaudio/gstosxaudiosink.c index e4211edc9c..024e8ce1a1 100644 --- a/subprojects/gst-plugins-good/sys/osxaudio/gstosxaudiosink.c +++ b/subprojects/gst-plugins-good/sys/osxaudio/gstosxaudiosink.c @@ -237,6 +237,11 @@ gst_osx_audio_sink_change_state (GstElement * element, GstStateChangeReturn ret; switch (transition) { + case GST_STATE_CHANGE_READY_TO_NULL: + GST_OBJECT_LOCK (osxsink); + osxsink->device_id = kAudioDeviceUnknown; + GST_OBJECT_UNLOCK (osxsink); + break; default: break; } @@ -254,7 +259,9 @@ gst_osx_audio_sink_change_state (GstElement * element, ringbuffer = GST_OSX_AUDIO_RING_BUFFER (GST_AUDIO_BASE_SINK (osxsink)->ringbuffer); if (ringbuffer->core_audio->device_id != osxsink->device_id) { + GST_OBJECT_LOCK (osxsink); osxsink->device_id = ringbuffer->core_audio->device_id; + GST_OBJECT_UNLOCK (osxsink); g_object_notify (G_OBJECT (osxsink), "device"); } break; diff --git a/subprojects/gst-plugins-good/sys/osxaudio/gstosxaudiosrc.c b/subprojects/gst-plugins-good/sys/osxaudio/gstosxaudiosrc.c index 0ae5e9ce62..6357bf4c2d 100644 --- a/subprojects/gst-plugins-good/sys/osxaudio/gstosxaudiosrc.c +++ b/subprojects/gst-plugins-good/sys/osxaudio/gstosxaudiosrc.c @@ -208,6 +208,12 @@ gst_osx_audio_src_change_state (GstElement * element, GstStateChange transition) GstStateChangeReturn ret; switch (transition) { + case GST_STATE_CHANGE_READY_TO_NULL:{ + GST_OBJECT_LOCK (osxsrc); + osxsrc->device_id = kAudioDeviceUnknown; + GST_OBJECT_UNLOCK (osxsrc); + break; + } default: break; } @@ -222,7 +228,10 @@ gst_osx_audio_src_change_state (GstElement * element, GstStateChange transition) ringbuffer = GST_OSX_AUDIO_RING_BUFFER (GST_AUDIO_BASE_SRC (osxsrc)->ringbuffer); if (ringbuffer->core_audio->device_id != osxsrc->device_id) { + GST_OBJECT_LOCK (osxsrc); osxsrc->device_id = ringbuffer->core_audio->device_id; + GST_OBJECT_UNLOCK (osxsrc); + g_object_notify (G_OBJECT (osxsrc), "device"); } break;