Revision 4364a3e0 libav/audio.c

View differences:

libav/audio.c
64 64
    }
65 65

  
66 66
    /* non blocking mode */
67
    fcntl(audio_fd, F_SETFL, O_NONBLOCK);
67
    if (!is_output)
68
        fcntl(audio_fd, F_SETFL, O_NONBLOCK);
68 69

  
69 70
    s->frame_size = AUDIO_BLOCK_SIZE;
70 71
#if 0
......
177 178
        if (s->buffer_ptr >= AUDIO_BLOCK_SIZE) {
178 179
            for(;;) {
179 180
                ret = write(s->fd, s->buffer, AUDIO_BLOCK_SIZE);
180
                if (ret != 0)
181
                if (ret > 0)
181 182
                    break;
182 183
                if (ret < 0 && (errno != EAGAIN && errno != EINTR))
183 184
                    return -EIO;

Also available in: Unified diff