{"action":"opened","issue":{"url":"https://api.github.com/repos/kinetiknz/cubeb/issues/475","repository_url":"https://api.github.com/repos/kinetiknz/cubeb","labels_url":"https://api.github.com/repos/kinetiknz/cubeb/issues/475/labels{/name}","comments_url":"https://api.github.com/repos/kinetiknz/cubeb/issues/475/comments","events_url":"https://api.github.com/repos/kinetiknz/cubeb/issues/475/events","html_url":"https://github.com/kinetiknz/cubeb/issues/475","id":380904207,"node_id":"MDU6SXNzdWUzODA5MDQyMDc=","number":475,"title":"Fail to unregister device changed callback with audiounit_stream_register_device_changed_callback","user":{"login":"ChunMinChang","id":5111652,"node_id":"MDQ6VXNlcjUxMTE2NTI=","avatar_url":"https://avatars3.githubusercontent.com/u/5111652?v=4","gravatar_id":"","url":"https://api.github.com/users/ChunMinChang","html_url":"https://github.com/ChunMinChang","followers_url":"https://api.github.com/users/ChunMinChang/followers","following_url":"https://api.github.com/users/ChunMinChang/following{/other_user}","gists_url":"https://api.github.com/users/ChunMinChang/gists{/gist_id}","starred_url":"https://api.github.com/users/ChunMinChang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChunMinChang/subscriptions","organizations_url":"https://api.github.com/users/ChunMinChang/orgs","repos_url":"https://api.github.com/users/ChunMinChang/repos","events_url":"https://api.github.com/users/ChunMinChang/events{/privacy}","received_events_url":"https://api.github.com/users/ChunMinChang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-14T21:56:14Z","updated_at":"2018-11-14T21:56:14Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"By the following comment,\r\nhttps://github.com/kinetiknz/cubeb/blob/9a7a55153e7f9b9e0036ab023909c7bc4a41688b/src/cubeb_audiounit.cpp#L3102-L3105\r\nit should have a way to unregister the `device_changed_callback` in the `stream`.  If `audiounit_stream_register_device_changed_callback` can cancel the original callback by registering a null callback, like what `audiounit_register_device_collection_changed` does, the following code should work:\r\n```cpp\r\nr = cubeb_stream_register_device_changed_callback(stream, device_changed_callback);\r\nASSERT_EQ(r, CUBEB_OK) << \"Error registering device changed callback\";\r\n\r\nr = cubeb_stream_register_device_changed_callback(stream, nullptr);\r\nASSERT_EQ(r, CUBEB_OK) << \"Error unregistering device changed callback\";\r\n```\r\n\r\nHowever, the above test code hit the assertion `assert(!stream->device_changed_callback)`. When the second `cubeb_stream_register_device_changed_callback` is called for unregistering, `stream->device_changed_callback` is not null.\r\n\r\nIf above test code is the expected behavior, I'd like to add tests for it. It can also help to verify the Rust implementation."}}
{"actor":{"display_login":"ChunMinChang"}}