0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

-loop patch by Pascal Haakmat <a.haakmat@chello.nl>

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2366 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2001-10-22 14:42:47 +00:00
parent f02eeb7172
commit 8235cbd0f9
2 changed files with 21 additions and 0 deletions

View File

@ -153,6 +153,7 @@ struct config conf[]={
{"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_STRING, CONF_MIN, 0, 0},
{"loop", &loop_times, CONF_TYPE_INT, CONF_RANGE, -1, 10000},
{"sound", &has_audio, CONF_TYPE_FLAG, 0, 0, 1},
{"nosound", &has_audio, CONF_TYPE_FLAG, 0, 1, 0},
{"abs", &ao_buffersize, CONF_TYPE_INT, CONF_MIN, 0, 0},

View File

@ -186,6 +186,7 @@ int osd_level=2;
char *seek_to_sec=NULL;
off_t seek_to_byte=0;
int has_audio=1;
int loop_times=-1;
char *audio_codec=NULL; // override audio codec
char *video_codec=NULL; // override video codec
@ -1848,6 +1849,25 @@ if(auto_quality>0){
seek_to_sec = NULL;
}
/* Looping. */
if(eof==5 && loop_times>-1) {
if(loop_times!=0) {
loop_times--;
if(loop_times==0)
loop_times=-1;
}
eof=0;
abs_seek_pos=1;
mp_msg(MSGT_CPLAYER,MSGL_V,"loop_times = %d, eof = 0\n", loop_times);
}
if(rel_seek_secs || abs_seek_pos){
current_module="seek";
if(demux_seek(demuxer,rel_seek_secs,abs_seek_pos)){