diff options
author | hoek <hoek@FreeBSD.org> | 2003-05-19 20:13:03 +0000 |
---|---|---|
committer | hoek <hoek@FreeBSD.org> | 2003-05-19 20:13:03 +0000 |
commit | d3bf58dfa016ec982490ae466cf88b913678e3b7 (patch) | |
tree | 01e9e480dc41d208c5a86e4d64139e442b8bcd90 /audio/cdplay | |
parent | 634d406b78441c2a0699d0bf0377c2c0f02a0c3f (diff) | |
download | FreeBSD-ports-d3bf58dfa016ec982490ae466cf88b913678e3b7.zip FreeBSD-ports-d3bf58dfa016ec982490ae466cf88b913678e3b7.tar.gz |
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.
Diffstat (limited to 'audio/cdplay')
-rw-r--r-- | audio/cdplay/Makefile | 2 | ||||
-rw-r--r-- | audio/cdplay/files/patch-ab | 82 | ||||
-rw-r--r-- | audio/cdplay/files/patch-ad | 26 | ||||
-rw-r--r-- | audio/cdplay/files/patch-ae | 72 |
4 files changed, 162 insertions, 20 deletions
diff --git a/audio/cdplay/Makefile b/audio/cdplay/Makefile index d16c110..662f301 100644 --- a/audio/cdplay/Makefile +++ b/audio/cdplay/Makefile @@ -7,7 +7,7 @@ PORTNAME= cdplay PORTVERSION= 0.92 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= audio MASTER_SITES= ${MASTER_SITE_LOCAL} MASTER_SITE_SUBDIR= dannyboy diff --git a/audio/cdplay/files/patch-ab b/audio/cdplay/files/patch-ab index 6d09ac7..11783cd 100644 --- a/audio/cdplay/files/patch-ab +++ b/audio/cdplay/files/patch-ab @@ -1,6 +1,9 @@ ---- cd.c.orig Fri Oct 24 11:38:25 1997 -+++ cd.c Sat Jun 27 00:53:10 1998 -@@ -98,8 +98,15 @@ + +$FreeBSD$ + +--- cd.c.orig Mon May 19 15:44:40 2003 ++++ cd.c Mon May 19 15:53:44 2003 +@@ -98,8 +98,16 @@ cd_play.end_s=cdinfo.s_sec[cdinfo.l_track-1]; cd_play.end_f=cdinfo.s_frame[cdinfo.l_track-1]; @@ -15,10 +18,11 @@ + } else + per(); + } ++ cdinfo.pause=0; } /* Skips one track forward */ -@@ -111,7 +118,7 @@ +@@ -111,7 +119,7 @@ /* Quess */ void prev(void) { @@ -27,7 +31,7 @@ play_track(cdinfo.c_track-1); else play_track(cdinfo.c_track); } -@@ -141,6 +148,43 @@ +@@ -141,17 +149,59 @@ } } @@ -69,5 +73,71 @@ +} + /* Huge kludge */ - void ff(void) +-void ff(void) ++void ff(int n_times) { ++ int secs; + struct ioc_play_msf cd_play; + +- if(cdinfo.c_seca%60+5>=60){ +- cd_play.start_s=((cdinfo.c_seca%60)+5)%60; ++ secs=4*n_times; ++ ++ if (secs > 59) secs=59; ++ ++ if(cdinfo.c_seca%60+secs>=60){ ++ cd_play.start_s=((cdinfo.c_seca%60)+secs)%60; + cd_play.start_m=cdinfo.c_seca/60+1; + } + else { +- cd_play.start_s=(cdinfo.c_seca%60)+5; ++ cd_play.start_s=(cdinfo.c_seca%60)+secs; + cd_play.start_m=cdinfo.c_seca/60; + } + cd_play.start_f=1; +@@ -160,19 +210,25 @@ + cd_play.end_f=cdinfo.s_frame[cdinfo.l_track-1]; + + if(ioctl(cd_fd,CDIOCPLAYMSF,(char *) &cd_play)<0) per(); ++ cdinfo.pause=0; + } + + /* Hi mom!! */ +-void rew(void) ++void rew(int n_times) + { ++ int secs; + struct ioc_play_msf cd_play; + +- if(cdinfo.c_seca%60-5<0){ +- cd_play.start_s=((cdinfo.c_seca%60)-5)+60; ++ secs=4*n_times; ++ ++ if (secs > 59) secs=59; ++ ++ if(cdinfo.c_seca%60-secs<0){ ++ cd_play.start_s=((cdinfo.c_seca%60)-secs)+60; + cd_play.start_m=cdinfo.c_seca/60-1; + } + else { +- cd_play.start_s=(cdinfo.c_seca%60)-5; ++ cd_play.start_s=(cdinfo.c_seca%60)-secs; + cd_play.start_m=cdinfo.c_seca/60; + } + cd_play.start_f=1; +@@ -181,6 +237,7 @@ + cd_play.end_f=cdinfo.s_frame[cdinfo.l_track-1]; + + if(ioctl(cd_fd,CDIOCPLAYMSF,(char *) &cd_play)<0) per(); ++ cdinfo.pause=0; + } + + /* Spit cd out */ +@@ -192,6 +249,7 @@ + per(); + close(cd_fd); + cdinfo.eject=1; ++ cdinfo.pause=1; + } + + diff --git a/audio/cdplay/files/patch-ad b/audio/cdplay/files/patch-ad index 0766f3a..c67e321 100644 --- a/audio/cdplay/files/patch-ad +++ b/audio/cdplay/files/patch-ad @@ -1,11 +1,25 @@ -diff -ur ../cdplay-0.92.orig/cdplay.h ./cdplay.h ---- ../cdplay-0.92.orig/cdplay.h Mon Nov 17 02:21:55 1997 -+++ ./cdplay.h Sat Jun 27 00:29:34 1998 -@@ -71,6 +71,7 @@ + +$FreeBSD$ + +--- ./cdplay.h.orig Mon May 19 15:44:41 2003 ++++ ./cdplay.h Mon May 19 15:55:12 2003 +@@ -71,8 +71,9 @@ void prev(void); void stop(void); void cdpause(void); +-void ff(void); +-void rew(void); +void cdsoftpause(void); - void ff(void); - void rew(void); ++void ff(int); ++void rew(int); void eject(void); + + /* Terminal related functions */ +@@ -90,6 +91,7 @@ + void hs_winch(void); + void do_exit(int); + void do_stop(void); ++void getcommand(char *command, int *repetivity); + + /* Awesome!!1!!1! 2 sound functions */ + void more_vol(void); diff --git a/audio/cdplay/files/patch-ae b/audio/cdplay/files/patch-ae index 0c7c50a..d204d58 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) |