snooze(1000);
static int audio_write_packet(AVFormatContext *s1, int stream_index,                              UINT8 *buf, int size, int force_pts){    AudioData *s = (AudioData *)s1->priv_data;    int len, ret;    while (size > 0) {        len = AUDIO_BLOCK_SIZE - s->buffer_ptr;        if (len > size)            len = size;        memcpy(s->buffer + s->buffer_ptr, buf, len);        s->buffer_ptr += len;        if (s->buffer_ptr >= AUDIO_BLOCK_SIZE) {            for(;;) {snooze(1000);                ret = write(s->fd, s->buffer, AUDIO_BLOCK_SIZE);                if (ret != 0)                    break;                if (ret < 0 && (errno != EAGAIN && errno != EINTR))                    return -EIO;            }            s->buffer_ptr = 0;        }        buf += len;        size -= len;    }    return 0;}