diff options
author | Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org> | 2003-02-05 20:31:02 +0000 |
---|---|---|
committer | Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org> | 2003-02-05 20:31:02 +0000 |
commit | 4a34b202c07a1986eae06d4e7c4a846faf9637cc (patch) | |
tree | ccdf885a8d6179faf0ac8b29f65f7bf461ce9c8e /multimedia/ffmpeg-devel/files | |
parent | Update to version 3.11. (diff) |
o Add a simple "block until data is available or timeout is reached"
wait mechanism to audio encoding routines. This avoids busy wait
blocking which needlessly consumes CPU
o Bump PORTREVISION
Submitted by: Steve O'Hara-Smith <steve@sohara.org>
Obtained from: ffmpeg CVS repository
Notes
Notes:
svn path=/head/; revision=74906
Diffstat (limited to 'multimedia/ffmpeg-devel/files')
-rw-r--r-- | multimedia/ffmpeg-devel/files/patch-libavformat::audio.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/multimedia/ffmpeg-devel/files/patch-libavformat::audio.c b/multimedia/ffmpeg-devel/files/patch-libavformat::audio.c new file mode 100644 index 000000000000..375a58dd7280 --- /dev/null +++ b/multimedia/ffmpeg-devel/files/patch-libavformat::audio.c @@ -0,0 +1,17 @@ +--- libavformat/audio.c.orig Wed Feb 5 20:49:08 2003 ++++ libavformat/audio.c Wed Feb 5 20:50:36 2003 +@@ -243,6 +243,14 @@ + if (av_new_packet(pkt, s->frame_size) < 0) + return -EIO; + for(;;) { ++ struct timeval tv; ++ fd_set fds; ++ tv.tv_sec = 0; ++ tv.tv_usec = 30 * 1000; /* 30 msecs -- a bit shorter than 1 frame at 30fps */ ++ FD_ZERO(&fds); ++ FD_SET(s->fd, &fds); /* This will block until data is available or we get a timeout */ ++ (void) select(s->fd + 1, &fds, 0, 0, &tv); ++ + ret = read(s->fd, pkt->data, pkt->size); + if (ret > 0) + break; |