[Mplayer-users] -ss, pg up/down patches
Loring Holden
lsh at cs.brown.edu
Thu Apr 26 19:06:10 CEST 2001
This patch does two things:
* Enable the -ss (seek to, in seconds) command line parameter, remnants of
which was in the code, but it wasn't working. This functionality has been
pretty popular locally, so I thought it would be good to publicize.
* Page up and Page down now seek 10 minutes forward and backward
respectively. This is a nice way to seek through a movie file quickly.
Loring
Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.37
diff -u -r1.37 cfg-mplayer.h
--- cfg-mplayer.h 2001/04/26 15:50:45 1.37
+++ cfg-mplayer.h 2001/04/26 16:58:20
@@ -58,7 +58,7 @@
{"bg", &play_in_bg, CONF_TYPE_FLAG, 0, 0, 1},
{"nobg", &play_in_bg, CONF_TYPE_FLAG, 0, 1, 0},
{"sb", &seek_to_byte, CONF_TYPE_INT, CONF_MIN, 0, 0},
-// {"ss", &seek_to_sec, CONF_TYPE_INT, CONF_MIN, 0, 0},
+ {"ss", &seek_to_sec, CONF_TYPE_INT, CONF_MIN, 0, 0},
{"sound", &has_audio, CONF_TYPE_FLAG, 0, 0, 1},
{"nosound", &has_audio, CONF_TYPE_FLAG, 0, 1, 0},
{"abs", &audio_buffer_size, CONF_TYPE_INT, CONF_MIN, 0, 0},
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.99
diff -u -r1.99 mplayer.c
--- mplayer.c 2001/04/26 15:50:45 1.99
+++ mplayer.c 2001/04/26 16:58:20
@@ -1668,6 +1668,11 @@
case KEY_DOWN:
osd_function=OSD_REW;
rel_seek_secs-=60;break;
+ // seek 10 min
+ case KEY_PAGE_UP:
+ rel_seek_secs+=600;break;
+ case KEY_PAGE_DOWN:
+ rel_seek_secs-=600;break;
// delay correction:
case '+':
buffer_delay+=0.1; // increase audio buffer delay
@@ -1714,6 +1719,10 @@
case 'm':
mixer_usemaster=!mixer_usemaster;
break;
+ }
+ if (seek_to_sec) {
+ rel_seek_secs += seek_to_sec;
+ seek_to_sec = 0;
}
if(rel_seek_secs)
if(file_format==DEMUXER_TYPE_AVI && demuxer->idx_size<=0){
Index: libvo/x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.15
diff -u -r1.15 x11_common.c
--- libvo/x11_common.c 2001/04/24 11:30:57 1.15
+++ libvo/x11_common.c 2001/04/26 16:58:20
@@ -92,6 +92,8 @@
case wsSpace: mplayer_put_key(' '); break;
case wsEscape: mplayer_put_key(KEY_ESC); break;
case wsEnter: mplayer_put_key(KEY_ENTER); break;
+ case wsPageUp: mplayer_put_key(KEY_PAGE_UP); break;
+ case wsPageDown: mplayer_put_key(KEY_PAGE_DOWN); break;
case wsq:
case wsQ: mplayer_put_key('q'); break;
case wsp:
_______________________________________________
Mplayer-users mailing list
Mplayer-users at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-users
More information about the MPlayer-users
mailing list