[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gap-dev-discuss] Cynthiune crash (AO)
From: |
Sebastian Reitenbach |
Subject: |
Re: [Gap-dev-discuss] Cynthiune crash (AO) |
Date: |
Mon, 07 May 2012 19:06:46 +0200 |
User-agent: |
SOGoMail 1.3.14 |
On Monday, May 7, 2012 18:47 CEST, Philippe Roussel <address@hidden> wrote:
> Le 07/05/2012 18:06, Sebastian Reitenbach a écrit :
> >> In any case, the two lines before the crash:
> >> ao_alsa WARNING: ao_plugin_close called with uninitialized
> >> ao_device->internal
> >> ao_alsa WARNING: ao_plugin_device_clear called with uninitialized
> >> ao_device->internal
> >>
> >> Point out to something illegal which can of course cause any kind of havoc.
> >>
> >> Before, when I played a bit with next/previous buttons, nothing
> >> happened. If it were consistent it would be easier to run it through GDB.
> >
> > The patch below works for me on macppc. I did put the lock outside the if
> > clause
> > in prepareDevice... method.
>
> And changed the return value from YES to NO when dev == NULL when the
Thanks for spotting that.
> method is called. I'm not sure this is correct. Could you try the
> modified version of you patch below ?
That seems to work much better, my other crasher I reported before, is also
gone.
I guess that was due to the wrong return value.
Sebastian
>
> Thanks,
> Philippe
>
> >
> > Index: Bundles/AO/ao.m
> > ===================================================================
> > RCS file: /sources/gap/gap/user-apps/Cynthiune/Bundles/AO/ao.m,v
> > retrieving revision 1.2
> > diff -u -r1.2 ao.m
> > --- Bundles/AO/ao.m 5 May 2012 12:23:41 -0000 1.2
> > +++ Bundles/AO/ao.m 7 May 2012 15:45:21 -0000
> > @@ -85,19 +85,22 @@
> > - (BOOL) prepareDeviceWithChannels: (unsigned int) numberOfChannels
> > andRate: (unsigned long) sampleRate
> > {
> > + BOOL result = NO;
> > +
> > format.channels = (int)numberOfChannels;
> > format.rate = (int)sampleRate;
> > /* FIXME : this should somehow come from the input bundle */
> > format.bits = 16;
> > format.byte_format = AO_FMT_LITTLE;
> > - if (dev) {
> > - [devlock lock];
> > - ao_close(dev);
> > - dev = ao_open_live(driver, &format, NULL);
> > - [devlock unlock];
> > - return ((dev == NULL) ? NO : YES);
> > - }
> > - return YES;
> > + [devlock lock];
> > + if (dev)
> > + {
> > + ao_close(dev);
> > + dev = ao_open_live(driver, &format, NULL);
> > + result = (dev == NULL) ? NO : YES;
> > + }
> > + [devlock unlock];
> > + return result;
> > }
> >
> > - (BOOL) openDevice