Ticket #255: pulseaudio-04-devname.diff

File pulseaudio-04-devname.diff, 0.9 KB (added by yippi, 4 years ago)

patch adding function to get devname

  • pulseaudio-0.9.5/src/modules/module-solaris.c

    old new  
    500500    return 0; 
    501501} 
    502502 
     503static int pa_solaris_get_devname(int fd, char *buf) { 
     504    audio_device_t dev; 
     505    if (ioctl(fd, AUDIO_GETDEV, &dev) < 0) { 
     506    return -1; 
     507    } 
     508    memcpy(buf, dev.name, MAX_AUDIO_DEV_LEN); 
     509    return 0; 
     510} 
     511 
    503512int pa__init(pa_core *c, pa_module*m) { 
    504513    struct userdata *u = NULL; 
    505514    const char *p; 
     515    char devname[MAX_AUDIO_DEV_LEN]; 
    506516    int fd = -1; 
    507517    int buffer_size; 
    508518    int mode; 
     
    548558 
    549559    pa_log_info("device opened in %s mode.", mode == O_WRONLY ? "O_WRONLY" : (mode == O_RDONLY ? "O_RDONLY" : "O_RDWR")); 
    550560 
     561    if (pa_solaris_get_devname(fd, devname) >= 0) 
     562        p = devname; 
     563     
    551564    if (pa_solaris_auto_format(fd, mode, &ss) < 0) 
    552565        goto fail; 
    553566