mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 17:59:20 -04:00
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
This commit is contained in:
parent
3932042f89
commit
4a34b202c0
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=74906
6 changed files with 54 additions and 3 deletions
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
PORTNAME= ffmpeg
|
PORTNAME= ffmpeg
|
||||||
PORTVERSION= 0.4.6
|
PORTVERSION= 0.4.6
|
||||||
PORTREVISION= 1
|
PORTREVISION= 2
|
||||||
CATEGORIES= multimedia audio net
|
CATEGORIES= multimedia audio net
|
||||||
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
||||||
MASTER_SITE_SUBDIR= ffmpeg
|
MASTER_SITE_SUBDIR= ffmpeg
|
||||||
|
|
17
multimedia/ffmpeg-devel/files/patch-libavformat::audio.c
Normal file
17
multimedia/ffmpeg-devel/files/patch-libavformat::audio.c
Normal file
|
@ -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;
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
PORTNAME= ffmpeg
|
PORTNAME= ffmpeg
|
||||||
PORTVERSION= 0.4.6
|
PORTVERSION= 0.4.6
|
||||||
PORTREVISION= 1
|
PORTREVISION= 2
|
||||||
CATEGORIES= multimedia audio net
|
CATEGORIES= multimedia audio net
|
||||||
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
||||||
MASTER_SITE_SUBDIR= ffmpeg
|
MASTER_SITE_SUBDIR= ffmpeg
|
||||||
|
|
17
multimedia/ffmpeg/files/patch-libavformat::audio.c
Normal file
17
multimedia/ffmpeg/files/patch-libavformat::audio.c
Normal file
|
@ -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;
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
PORTNAME= ffmpeg
|
PORTNAME= ffmpeg
|
||||||
PORTVERSION= 0.4.5
|
PORTVERSION= 0.4.5
|
||||||
PORTREVISION= 5
|
PORTREVISION= 6
|
||||||
CATEGORIES= multimedia audio net
|
CATEGORIES= multimedia audio net
|
||||||
MASTER_SITES= ${MASTER_SITE_LOCAL}
|
MASTER_SITES= ${MASTER_SITE_LOCAL}
|
||||||
MASTER_SITE_SUBDIR= lioux
|
MASTER_SITE_SUBDIR= lioux
|
||||||
|
|
17
multimedia/ffmpeg045/files/patch-libav::audio.c
Normal file
17
multimedia/ffmpeg045/files/patch-libav::audio.c
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
--- libav/audio.c.orig Wed Feb 5 20:49:08 2003
|
||||||
|
+++ libav/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;
|
Loading…
Add table
Reference in a new issue