On Mon, 18 Nov 2013 16:03:45 +0100 Stefan Schmidt <ste...@datenfreihafen.org>
said:

> Hello.
> 
> On Sat, 2013-11-16 at 18:11, Carsten Haitzler wrote:
> > raster pushed a commit to branch master.
> > 
> > http://git.enlightenment.org/core/efl.git/commit/?id=80d666e7a461c8c76adb01788dc746146bf8ab35
> > 
> > commit 80d666e7a461c8c76adb01788dc746146bf8ab35
> > Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
> > Date:   Sun Nov 17 11:03:20 2013 +0900
> > 
> >     ecore-audio - protect against more list-walking while list is modified
> 
> And the e-b0rker trophy for this weekened goes to ... (short pause to
> get full attention of the audience)
> 
> raster himself!!!!!
> 
> (Tears and hugs all over the stage)
> 
> You tried to cover this with the crippled echo on bsd fix you reviewed
> and put it which broke make distcheck on. After fixing this I had to
> learn that this broke ecore tests in make distcheck. Not in make check
> though. Seems like Cedrics job in Korea is indeed done.

the echo fix worked. make doc worked at any rate. i did comment that the double
\\ was odd in the approval comments.

> More seriously I have no idea why it breaks but reverting this one
> commit makes it worki again. After fixing the other one I'm to lazy to
> fix this now. Lucky for you I'm also to lazy to revert. Or I'm in hope
> someone will have a look soon. :)

i cannot see why this breaks something. it does fix things when you DONT have
pulseaudio working... and you need to make sounds. ie there are multiple  audio
ev out fails waiting to be called and the callbacks are deleting the out
objects AS the list is being walked. this forces all of the objects int he list
to first add a refcount to ensure they stay - then walk, then walk through and
unref them safely (if the current obj unref gets it to 0 - it may be removed
from the list, but we use the safe foreach so we're good).

so there's an extra ref of all list items then unref of list items arfter all
is said and done to fix the issue at hand. so removing this would cause segs
for ppl without pulse when audio is used.

> regards
> Stefan Schmidt
> 
> 
> > ---
> >  src/lib/ecore_audio/ecore_audio_obj_out_pulse.c | 50 +++++++++++++
> > +----------- 1 file changed, 29 insertions(+), 21 deletions(-)
> > 
> > diff --git a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
> > b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c index 11fc20f..ce7bd7f
> > 100644
> > --- a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
> > +++ b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
> > @@ -214,27 +214,35 @@ static void _input_detach(Eo *eo_obj, void *_pd
> > EINA_UNUSED, va_list *list) 
> >  static void _state_cb(pa_context *context, void *data EINA_UNUSED)
> >  {
> > -  Eina_List *out;
> > -  Eo *eo_obj;
> > -  pa_context_state_t state;
> > -
> > -  state = pa_context_get_state(context);
> > -  class_vars.state = state;
> > -
> > -  if (state == PA_CONTEXT_READY) {
> > -    DBG("PA context ready.");
> > -    EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) {
> > -      eo_do(eo_obj, eo_event_callback_call
> > (ECORE_AUDIO_EV_OUT_PULSE_CONTEXT_READY, NULL, NULL));
> > -    }
> > -  } else if ((state == PA_CONTEXT_FAILED) || (state ==
> > PA_CONTEXT_TERMINATED)) {
> > -    DBG("PA context fail.");
> > -    EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) {
> > -      eo_do(eo_obj, eo_event_callback_call
> > (ECORE_AUDIO_EV_OUT_PULSE_CONTEXT_FAIL, NULL, NULL));
> > -    }
> > -  } else {
> > -    DBG("Connection state %i", state);
> > -  }
> > -
> > +   Eina_List *out, *tmp;
> > +   Eo *eo_obj;
> > +   pa_context_state_t state;
> > +   
> > +   state = pa_context_get_state(context);
> > +   class_vars.state = state;
> > +   
> > +   //ref everything in the list to be sure...
> > +   EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) {
> > +      eo_ref(eo_obj);
> > +   }
> > +   // the callback here can delete things in the list..
> > +   if (state == PA_CONTEXT_READY) {
> > +      DBG("PA context ready.");
> > +      EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) {
> > +         eo_do(eo_obj, eo_event_callback_call
> > (ECORE_AUDIO_EV_OUT_PULSE_CONTEXT_READY, NULL, NULL));
> > +      }
> > +   } else if ((state == PA_CONTEXT_FAILED) || (state ==
> > PA_CONTEXT_TERMINATED)) {
> > +      DBG("PA context fail.");
> > +      EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) {
> > +         eo_do(eo_obj, eo_event_callback_call
> > (ECORE_AUDIO_EV_OUT_PULSE_CONTEXT_FAIL, NULL, NULL));
> > +      }
> > +   } else {
> > +      DBG("Connection state %i", state);
> > +   }
> > +   // now unref everything safely
> > +   EINA_LIST_FOREACH_SAFE(class_vars.outputs, out, tmp, eo_obj) {
> > +      eo_unref(eo_obj);
> > +   }
> >  }
> >  
> >  static void _state_job(void *data EINA_UNUSED)
> > 
> > -- 
> > 
> > 
> 
> ------------------------------------------------------------------------------
> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
> Free app hosting. Or install the open source package on any LAMP server.
> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    ras...@rasterman.com


------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to