gap-dev-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gap-dev-discuss] Cynthiune crash (AO)


From: Philippe Roussel
Subject: Re: [Gap-dev-discuss] Cynthiune crash (AO)
Date: Mon, 07 May 2012 18:47:04 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

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
method is called. I'm not sure this is correct. Could you try the
modified version of you patch below ?

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

Attachment: ao.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]