Commit 4cb3728a authored by bellard's avatar bellard

better than nothing patch for correct audio output with ffplay


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@1230 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent e8e2561e
...@@ -64,7 +64,8 @@ static int audio_open(AudioData *s, int is_output) ...@@ -64,7 +64,8 @@ static int audio_open(AudioData *s, int is_output)
} }
/* non blocking mode */ /* 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; s->frame_size = AUDIO_BLOCK_SIZE;
#if 0 #if 0
...@@ -177,7 +178,7 @@ static int audio_write_packet(AVFormatContext *s1, int stream_index, ...@@ -177,7 +178,7 @@ static int audio_write_packet(AVFormatContext *s1, int stream_index,
if (s->buffer_ptr >= AUDIO_BLOCK_SIZE) { if (s->buffer_ptr >= AUDIO_BLOCK_SIZE) {
for(;;) { for(;;) {
ret = write(s->fd, s->buffer, AUDIO_BLOCK_SIZE); ret = write(s->fd, s->buffer, AUDIO_BLOCK_SIZE);
if (ret != 0) if (ret > 0)
break; break;
if (ret < 0 && (errno != EAGAIN && errno != EINTR)) if (ret < 0 && (errno != EAGAIN && errno != EINTR))
return -EIO; return -EIO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment