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

Move loop_times into mpctx.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23746 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
albeu 2007-07-09 14:51:47 +00:00
parent 1544e64717
commit f48a4beff0
3 changed files with 10 additions and 9 deletions

View File

@ -353,8 +353,8 @@ m_option_t mplayer_opts[]={
{"guiwid", &guiWinID, CONF_TYPE_INT, 0, 0, 0, NULL},
#endif
{"noloop", &loop_times, CONF_TYPE_FLAG, 0, 0, -1, NULL},
{"loop", &loop_times, CONF_TYPE_INT, CONF_RANGE, -1, 10000, NULL},
{"noloop", &mpctx_s.loop_times, CONF_TYPE_FLAG, 0, 0, -1, NULL},
{"loop", &mpctx_s.loop_times, CONF_TYPE_INT, CONF_RANGE, -1, 10000, NULL},
{"playlist", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL},
// a-v sync stuff:

View File

@ -51,6 +51,7 @@ typedef struct MPContext {
play_tree_iter_t *playtree_iter;
int eof;
int play_tree_step;
int loop_times;
stream_t *stream;
demuxer_t *demuxer;

View File

@ -200,6 +200,7 @@ static MPContext mpctx_s = {
.global_sub_pos = -1,
.set_of_sub_pos = -1,
.file_format = DEMUXER_TYPE_UNKNOWN,
.loop_times = -1,
#ifdef HAS_DVBIN_SUPPORT
.last_dvb_step = 1,
#endif
@ -244,7 +245,6 @@ static char* playing_msg = NULL;
static double seek_to_sec;
static off_t seek_to_byte=0;
static off_t step_sec=0;
static int loop_times=-1;
static int loop_seek=0;
static m_time_size_t end_at = { .type = END_AT_NONE, .pos = 0 };
@ -3326,8 +3326,8 @@ if (mpctx->stream->type==STREAMTYPE_TV) mp_input_set_section("tv");
//==================== START PLAYING =======================
if(loop_times>1) loop_times--; else
if(loop_times==1) loop_times = -1;
if(mpctx->loop_times>1) mpctx->loop_times--; else
if(mpctx->loop_times==1) mpctx->loop_times = -1;
mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_StartPlaying);
@ -3528,11 +3528,11 @@ if(step_sec>0) {
mpctx->was_paused = 0;
/* Looping. */
if(mpctx->eof==1 && loop_times>=0) {
mp_msg(MSGT_CPLAYER,MSGL_V,"loop_times = %d, eof = %d\n", loop_times,mpctx->eof);
if(mpctx->eof==1 && mpctx->loop_times>=0) {
mp_msg(MSGT_CPLAYER,MSGL_V,"loop_times = %d, eof = %d\n", mpctx->loop_times,mpctx->eof);
if(loop_times>1) loop_times--; else
if(loop_times==1) loop_times=-1;
if(mpctx->loop_times>1) mpctx->loop_times--; else
if(mpctx->loop_times==1) mpctx->loop_times=-1;
play_n_frames=play_n_frames_mf;
mpctx->eof=0;
abs_seek_pos=1; rel_seek_secs=seek_to_sec;