Oh wait sorry. The delay one. I was thinking about the one in add packets :)

I'll see if I can find the code I used as reference for the delay. I think
it's mplayer or vlc.
Den 7 jan 2014 19:47 skrev "Tobias Arrskog" <topfs2@xboxmediacenter.com>:

> I think its perfectly OK. The stream request callback will signal the main
> loop when the buffer has room and it will then trigger the wait to unblock.
>
> So in essence, all other solutions with the callback would end up with
> essentially the same behaviour.
> Den 7 jan 2014 18:35 skrev "Rainer Hochecker" <notifications@github.com>:
>
>> In xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp:
>>
>> > +
>> > +  if (m_MainLoop)
>> > +  {
>> > +    pa_threaded_mainloop_free(m_MainLoop);
>> > +    m_MainLoop = NULL;
>> > +  }
>> > +}
>> > +
>> > +double CAESinkPULSE::GetDelay()
>> > +{
>> > +  if (!m_IsAllocated)
>> > +    return 0;
>> > +
>> > +  pa_usec_t latency = (pa_usec_t) -1;
>> > +  pa_threaded_mainloop_lock(m_MainLoop);
>> > +  while (pa_stream_get_latency(m_Stream, &latency, NULL) < 0)
>>
>> i don't like this loop and wait here. there must be a better solution.
>>
>> —
>> Reply to this email directly or view it on GitHub<https://github.com/xbmc/xbmc/pull/3976/files#r8699983>
>> .
>>
>