summaryrefslogtreecommitdiff
path: root/audio/cdplay/files/patch-ae
diff options
context:
space:
mode:
authorTim Vanderhoek <hoek@FreeBSD.org>2003-05-19 20:13:03 +0000
committerTim Vanderhoek <hoek@FreeBSD.org>2003-05-19 20:13:03 +0000
commitc4cb43a7d3e755133c8946f65750cd204a52f4c0 (patch)
tree4ce3ee29c195436a1130ffe7838e9400425030cd /audio/cdplay/files/patch-ae
parentMark ONLY_FOR_ARCHS=i386. (diff)
Patches for:
1) Avoid becoming confused about the current state of "pause" when rewinding/forwarding to the prev/next track. 2) Use capital 'E' instead of lower 'e' for Eject. The 'e' button is too close to the 'r' button and accidentally ejecting when you're trying to rewind is really annoying. 3) When multiple subsequent r)ewind or f)orward operations are used before the ioctl() from an earlier r)ewind or f)orward has returned, perform the delayed 'r' and 'f' operations all at once rather than individually (and serially). This avoids a buffer overflow crash that could occur and also makes the 'r' and 'f' controls much more usable Update PORTREVISION for these improvements.
Notes
Notes: svn path=/head/; revision=81489
Diffstat (limited to 'audio/cdplay/files/patch-ae')
-rw-r--r--audio/cdplay/files/patch-ae72
1 files changed, 65 insertions, 7 deletions
diff --git a/audio/cdplay/files/patch-ae b/audio/cdplay/files/patch-ae
index 0c7c50aec1e0..d204d5834052 100644
--- a/audio/cdplay/files/patch-ae
+++ b/audio/cdplay/files/patch-ae
@@ -1,7 +1,14 @@
-diff -ur ../cdplay-0.92.orig/main.c ./main.c
---- ../cdplay-0.92.orig/main.c Mon Nov 17 04:26:26 1997
-+++ ./main.c Sat Jun 27 00:29:34 1998
-@@ -39,7 +39,9 @@
+
+$FreeBSD$
+
+--- ./main.c.orig Mon May 19 15:44:41 2003
++++ ./main.c Mon May 19 15:55:24 2003
+@@ -35,11 +35,14 @@
+ int main(int argc, char **argv)
+ {
+ char cmd[1];
++ int repetivity;
+ fd_set rset;
struct timeval stime;
/* Parse arguments */
@@ -12,11 +19,25 @@ diff -ur ../cdplay-0.92.orig/main.c ./main.c
if(argc>1 && !strcmp(argv[1],"-d"))
cd_device=argv[2];
else if(argc>1)
-@@ -77,10 +79,11 @@
- else if(cmd[0]=='r'){message="rew";rew();}
+@@ -68,19 +71,20 @@
+
+ while(1){
+ if(select(1,&rset,(fd_set *) 0,(fd_set *) 0,&stime)>0) {
+- read(STDIN_FILENO,cmd,FD_SETSIZE);
+-
++ getcommand(&cmd[0], &repetivity);
++
+ if(cmd[0]=='p'){message="play";play_track(1);}
+ else if(cmd[0]=='F'){message="next";next();}
+ else if(cmd[0]=='R'){message="prev";prev();}
+- else if(cmd[0]=='f'){message="ff";ff();}
+- else if(cmd[0]=='r'){message="rew";rew();}
++ else if(cmd[0]=='f'){message="ff";ff(repetivity);}
++ else if(cmd[0]=='r'){message="rew";rew(repetivity);}
else if(cmd[0]=='s'){message="stop";stop();}
- else if(cmd[0]=='e'){message="eject";eject();}
+- else if(cmd[0]=='e'){message="eject";eject();}
- else if(cmd[0]==' ') cdpause();
++ else if(cmd[0]=='E'){message="eject";eject();}
+ else if(cmd[0]==' ') cdsoftpause();
else if(cmd[0]=='+'){message="more vol";more_vol();}
else if(cmd[0]=='-'){message="less vol";less_vol();}
@@ -25,3 +46,40 @@ diff -ur ../cdplay-0.92.orig/main.c ./main.c
}
update_cdinfo();
move_up(5);
+@@ -90,6 +94,36 @@
+ }
+
+ exit(0);
++}
++
++void getcommand(char *command, int *repetivity)
++{
++ static char stored_command;
++ int n;
++
++ fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK);
++
++ if (stored_command) {
++ *command=stored_command;
++ } else {
++ n=read(STDIN_FILENO,command,1);
++ if (n <= 0) {
++ *command='\0';
++ *repetivity=0;
++ return;
++ }
++ }
++
++ *repetivity=1;
++ while (read(STDIN_FILENO, &stored_command, 1) > 0) {
++ if (stored_command == *command) {
++ (*repetivity)++;
++ } else {
++ return;
++ }
++ }
++ stored_command='\0';
++ return;
+ }
+
+ void hs_cont(void)