diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2002-11-19 18:21:18 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2002-11-19 18:21:18 +0000 |
commit | 4364a3e01657021646aba65b45341a00dff489ce (patch) | |
tree | e0b42a92e23e6996d6328d08f66b7e547383d6c4 | |
parent | 45dd5c69f91eca28e03cffedfe10c4b5557a5ee7 (diff) | |
download | ffmpeg-4364a3e01657021646aba65b45341a00dff489ce.tar.gz |
better than nothing patch for correct audio output with ffplay
Originally committed as revision 1230 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libav/audio.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libav/audio.c b/libav/audio.c index 34da590916..4fa155c85d 100644 --- a/libav/audio.c +++ b/libav/audio.c @@ -64,7 +64,8 @@ static int audio_open(AudioData *s, int is_output) } /* non blocking mode */ - fcntl(audio_fd, F_SETFL, O_NONBLOCK); + if (!is_output) + fcntl(audio_fd, F_SETFL, O_NONBLOCK); s->frame_size = AUDIO_BLOCK_SIZE; #if 0 @@ -177,7 +178,7 @@ static int audio_write_packet(AVFormatContext *s1, int stream_index, if (s->buffer_ptr >= AUDIO_BLOCK_SIZE) { for(;;) { ret = write(s->fd, s->buffer, AUDIO_BLOCK_SIZE); - if (ret != 0) + if (ret > 0) break; if (ret < 0 && (errno != EAGAIN && errno != EINTR)) return -EIO; |