[RFC][PATCH] Initialise write_volume callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi list,

I was getting some warnings about possible uninitialised variables in
pulsecore/{source,sink}.c. At first the solution seemed obvious: just
set the callback to NULL in reset_callbacks, as it looks like it was
forgotten to be added there when write_volume was added.

The attached patch does this and indeed solves the warning about
reading from uninitialised memory. But it triggers an assert:
E: sink.c: Assertion 's->write_volume' failed at
pulsecore/sink.c:3353, function pa_sink_volume_change_apply().
Aborting.

This can be worked around by not adding the line "s->write_volume =
NULL" to reset_callbacks(), but do after reset_callbacks() is called
in pa_sink_new() and not adding it at the other place
reset_callbacks() is called, pa_sink_unlink().

However adding the initialisatino to reset_callbacks seems better to
me. Does anyone have a suggestion how to fix this?

Maarten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Initialise-write_volume.patch
Type: application/octet-stream
Size: 1134 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20110813/92396ebf/attachment.obj>


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux