mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 13:17:13 +00: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:
parent
f02eeb7172
commit
8235cbd0f9
@ -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},
|
||||
|
20
mplayer.c
20
mplayer.c
@ -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)){
|
||||
|
Loading…
Reference in New Issue
Block a user