On Monday 19 March 2018 12:03:15 fredvs wrote:
> >> I think that I will stay happy with your workaround on pcaudiolib....
> >
> > Which workaround?
>
> int
> alsa_object_flush(struct audio_object *object)
> {
>       struct alsa_object *self = to_alsa_object(object);
>       if (self && self->handle){
>               snd_pcm_drop(self->handle);
>       }
>       if (!self) return 0;
>
>       // Using snd_pcm_drop does not discard the audio, so reopen the device
>       // to reset the sound buffer.
>       if (self->is_open) {
>               audio_object_close(object);
>                       //this crashes write operation in other thread!
>               return audio_object_open(object, self->format, self->rate,
> self->channels);
>       }
>
>       return 0;
> }
>
That means you first call snd_pcm_drop() and then you close and reopen the 
audio object? Doesn't this crash a running write operatipns in another 
thread?
Please remember that audio_object_close() frees all resources which maybe 
still are in use in other threads.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to