After the indirection patches, we don't wait unitl OpenSink() is finished. So there can be race conditions, when we remove the master stream. Basically, when removing such a stream and deleting it, it must be set to NULL - as every other check in e.g. outputrawstage won't work correctly.
The first idea to use "boolean guards" (TM) was not really smart and only made it harder to reproduce - as it helped sometimes.
FreeStream has a streamlock, it deletes / removes the stream there, sets it to NULL. OutputRawstream has the same lock, so comes in before or afterwards.
Having a dangeling pointer, e.g. not setting m_masterstream = NULL was just bad.
A nice good morning ping from germany goes to @davilla @wsnipex @pike @ronie
AE: fix segfault after indirection patches
do you plan on fxing up pap after your endevours? its back to eating a full core..
Hehe - i am pretty new to this stuff. I have some things on my todo list for AE. The last patch series enables Sleep Possibility on Alsa - so you should see really improved idle power usage. When the sink gets unloaded, it basically stays in SoftSuspend, e.g. ProcessSuspend(); and sleeps quite long naps.
Can you be more concrete on your mentioned issue and how to reproduce? As I did not realize increased CPU usage.
An OpenELEC build with the patch applied is here: https://dl.dropbox.com/u/55728161/OpenELEC-Generic.i386-devel-20130223172218-r13361.tar.bz2
seems to fix the switching issue here on intel
works for me.
edit: confirmed unrelated to this PR:
while testing I noticed that switching audio output from the audio OSD(while playing a video) does not work. I can cycle through hdmi, spdif, analog, but output device stays the same as configured in settings.
@davilla: Please also for frodo.1