[MPlayer-dev-eng] [PATCH] Fix a sndio crash when exiting in muted state

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Mar 25 17:17:29 EET 2023



> On 22 Mar 2023, at 22:58, Reimar Döffinger <Reimar.Doeffinger at gmx.de> wrote:
> 
>> Index: libao2/ao_sndio.c
>> ===================================================================
>> --- libao2/ao_sndio.c (revision 38412)
>> +++ libao2/ao_sndio.c (working copy)
>> @@ -159,6 +159,7 @@
>>    pfds = NULL;
>>    sio_close(hdl);
>>    hdl = NULL;
>> +    havevol = 0;
>>    return 0;
>> }
>> 
>> @@ -172,6 +173,7 @@
>>    hdl = NULL;
>>    free(pfds);
>>    pfds = NULL;
>> +    havevol = 0;
>> }
> 
> Well, it's probably a good idea to do that, but a aoctl happening after uninit (if I understand right) is the far worse issue an probably needs to be fixed by itself.

I can confirm this needs to be fixed elsewhere, as I get exactly the same crash e.g. on macos with ao_coreaudio.
The backtrace there looks like this:

  * frame #0: 0x0000000100019868 mplayer`control(cmd=5, arg=0x000000016fdfe490) at ao_coreaudio.c:197:11 [opt]
    frame #1: 0x000000010000a7e8 mplayer`mixer_setvolume(mixer=0x0000000100f194c0, l=<unavailable>, r=<unavailable>) at mixer.c:70:23 [opt]
    frame #2: 0x000000010000aa5c mplayer`mixer_mute(mixer=<unavailable>) at mixer.c:136:3 [opt] [artificial]
    frame #3: 0x000000010000b880 mplayer`exit_player_with_rc(how=EXIT_EOF, rc=0) at mplayer.c:706:9 [opt]
    frame #4: 0x0000000100010f78 mplayer`main(argc=<unavailable>, argv=<unavailable>) at mplayer.c:0 [opt]
    frame #5: 0x000000018e57fe50 dyld`start + 2544

I suspect that when doing ao uninit the mixer needs to be updated?


More information about the MPlayer-dev-eng mailing list