aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia/ffmpeg
diff options
context:
space:
mode:
authorlioux <lioux@FreeBSD.org>2003-02-06 04:31:02 +0800
committerlioux <lioux@FreeBSD.org>2003-02-06 04:31:02 +0800
commite7155cc3abadb255ce4ffc6862d746b7edabea7e (patch)
tree5f0ab60ec52ab1f1e7ead9a8eb4eb8e853d1c00e /multimedia/ffmpeg
parent8e1ee10e0157a280a60adf521361dffb0fd6f655 (diff)
downloadfreebsd-ports-graphics-e7155cc3abadb255ce4ffc6862d746b7edabea7e.tar.gz
freebsd-ports-graphics-e7155cc3abadb255ce4ffc6862d746b7edabea7e.tar.zst
freebsd-ports-graphics-e7155cc3abadb255ce4ffc6862d746b7edabea7e.zip
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
Diffstat (limited to 'multimedia/ffmpeg')
-rw-r--r--multimedia/ffmpeg/Makefile2
-rw-r--r--multimedia/ffmpeg/files/patch-libavformat::audio.c17
2 files changed, 18 insertions, 1 deletions
diff --git a/multimedia/ffmpeg/Makefile b/multimedia/ffmpeg/Makefile
index 5afe286479d..05aaedb9676 100644
--- a/multimedia/ffmpeg/Makefile
+++ b/multimedia/ffmpeg/Makefile
@@ -7,7 +7,7 @@
PORTNAME= ffmpeg
PORTVERSION= 0.4.6
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= multimedia audio net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ffmpeg
diff --git a/multimedia/ffmpeg/files/patch-libavformat::audio.c b/multimedia/ffmpeg/files/patch-libavformat::audio.c
new file mode 100644
index 00000000000..375a58dd728
--- /dev/null
+++ b/multimedia/ffmpeg/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;