[pulseaudio-discuss] [PATCH 1/5] module-coreaudio-detect: fix pa__done()
From: Daniel Mack dan...@caiaq.de This would have crashed when unloading the module. --- src/modules/coreaudio/module-coreaudio-detect.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/src/modules/coreaudio/module-coreaudio-detect.c b/src/modules/coreaudio/module-coreaudio-detect.c index 1d26b84..fda1f17 100644 --- a/src/modules/coreaudio/module-coreaudio-detect.c +++ b/src/modules/coreaudio/module-coreaudio-detect.c @@ -231,13 +231,10 @@ fail: } void pa__done(pa_module *m) { -struct userdata *u; +struct userdata *u = m-userdata; struct ca_device *dev = u-devices; AudioObjectPropertyAddress property_address; -pa_assert(m); -pa_assert_se(u = m-userdata); - property_address.mSelector = kAudioHardwarePropertyDevices; property_address.mScope = kAudioObjectPropertyScopeGlobal; property_address.mElement = kAudioObjectPropertyElementMaster; -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH 1/5] module-coreaudio-detect: fix pa__done()
On Sun, 2011-03-20 at 18:39 +0100, Daniel Mack wrote: void pa__done(pa_module *m) { -struct userdata *u; +struct userdata *u = m-userdata; struct ca_device *dev = u-devices; AudioObjectPropertyAddress property_address; -pa_assert(m); -pa_assert_se(u = m-userdata); - property_address.mSelector = kAudioHardwarePropertyDevices; property_address.mScope = kAudioObjectPropertyScopeGlobal; property_address.mElement = kAudioObjectPropertyElementMaster; I think the old assertions were good. I'd rather initialize dev after the assertions. -- Tanu ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH 1/5] module-coreaudio-detect: fix pa__done()
'Twas brillig, and Daniel Mack at 20/03/11 17:39 did gyre and gimble: From: Daniel Mack dan...@caiaq.de This would have crashed when unloading the module. --- src/modules/coreaudio/module-coreaudio-detect.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/src/modules/coreaudio/module-coreaudio-detect.c b/src/modules/coreaudio/module-coreaudio-detect.c index 1d26b84..fda1f17 100644 --- a/src/modules/coreaudio/module-coreaudio-detect.c +++ b/src/modules/coreaudio/module-coreaudio-detect.c @@ -231,13 +231,10 @@ fail: } void pa__done(pa_module *m) { -struct userdata *u; +struct userdata *u = m-userdata; struct ca_device *dev = u-devices; AudioObjectPropertyAddress property_address; -pa_assert(m); -pa_assert_se(u = m-userdata); - property_address.mSelector = kAudioHardwarePropertyDevices; property_address.mScope = kAudioObjectPropertyScopeGlobal; property_address.mElement = kAudioObjectPropertyElementMaster; From what I can see, most modules are still calling pa_assert(m) so it's probably better to keep the assert in there and just move the dev = u-devices line lower. Other than that the other patches are all fine. Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mageia Contributor [http://www.mageia.org/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH 1/5] module-coreaudio-detect: fix pa__done()
On Mar 20, 2011 7:15 PM, Colin Guthrie gm...@colin.guthr.ie wrote: 'Twas brillig, and Daniel Mack at 20/03/11 17:39 did gyre and gimble: From: Daniel Mack dan...@caiaq.de This would have crashed when unloading the module. --- src/modules/coreaudio/module-coreaudio-detect.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/src/modules/coreaudio/module-coreaudio-detect.c b/src/modules/coreaudio/module-coreaudio-detect.c index 1d26b84..fda1f17 100644 --- a/src/modules/coreaudio/module-coreaudio-detect.c +++ b/src/modules/coreaudio/module-coreaudio-detect.c @@ -231,13 +231,10 @@ fail: } void pa__done(pa_module *m) { -struct userdata *u; +struct userdata *u = m-userdata; struct ca_device *dev = u-devices; AudioObjectPropertyAddress property_address; -pa_assert(m); -pa_assert_se(u = m-userdata); - property_address.mSelector = kAudioHardwarePropertyDevices; property_address.mScope = kAudioObjectPropertyScopeGlobal; property_address.mElement = kAudioObjectPropertyElementMaster; From what I can see, most modules are still calling pa_assert(m) so it's probably better to keep the assert in there and just move the dev = u-devices line lower. Other than that the other patches are all fine. Ok, can you add it back and amend the patch? I think that would be easier than resending :-) Thanks, Daniel ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH 1/5] module-coreaudio-detect: fix pa__done()
'Twas brillig, and Daniel Mack at 20/03/11 18:26 did gyre and gimble: Other than that the other patches are all fine. Ok, can you add it back and amend the patch? I think that would be easier than resending :-) Yeah, no worries, editited in my tree. Tanu had a couple comments on patches 3 and 5 tho' (you answered his comment on patch 4 already). If you can comment on them I'll merge (and/or fix up as needed). Cheers Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mageia Contributor [http://www.mageia.org/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss