[MPlayer-cvslog] r23746 - in trunk: cfg-mplayer.h mp_core.h mplayer.c

albeu subversion at mplayerhq.hu
Mon Jul 9 16:51:48 CEST 2007


Author: albeu
Date: Mon Jul  9 16:51:47 2007
New Revision: 23746

Log:
Move loop_times into mpctx.


Modified:
   trunk/cfg-mplayer.h
   trunk/mp_core.h
   trunk/mplayer.c

Modified: trunk/cfg-mplayer.h
==============================================================================
--- trunk/cfg-mplayer.h	(original)
+++ trunk/cfg-mplayer.h	Mon Jul  9 16:51:47 2007
@@ -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:

Modified: trunk/mp_core.h
==============================================================================
--- trunk/mp_core.h	(original)
+++ trunk/mp_core.h	Mon Jul  9 16:51:47 2007
@@ -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;

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	(original)
+++ trunk/mplayer.c	Mon Jul  9 16:51:47 2007
@@ -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) 
 
 //==================== 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;



More information about the MPlayer-cvslog mailing list