AE: Fix segfault after indirection patches #2289

Merged
merged 1 commit into from Feb 24, 2013

Projects

None yet

4 participants

@fritsch
Member
fritsch commented Feb 23, 2013

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.

Basically:
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

@ghost
ghost commented Feb 23, 2013

do you plan on fxing up pap after your endevours? its back to eating a full core..

Member
fritsch commented Feb 23, 2013

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.

Owner
pike2k commented Feb 23, 2013

seems to fix the switching issue here on intel

Member
wsnipex commented Feb 24, 2013

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 davilla merged commit 9a5b151 into xbmc:master Feb 24, 2013
@fritsch
Member

@davilla: Please also for frodo.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment