s->player->SetHasData(false);
static void audioplay_callback(void *cookie, void *buffer, size_t bufferSize, const media_raw_audio_format &format){    AudioData *s;    size_t amount;    unsigned char *buf = (unsigned char *)buffer;    s = (AudioData *)cookie;    if (s->has_quit)        return;    while (bufferSize > 0) {        if ((amount = read(s->pipefd, buf, bufferSize)) < B_OK) {            puts("EPIPE");            snooze(100000);            s->player->SetHasData(false);            return;        }        if (amount == 0) {            snooze(100000);            s->player->SetHasData(false);            return;        }        buf += amount;        bufferSize -= amount;    }}