[Mplayer-cvslog] CVS: main mplayer.c,1.806,1.807

Reynaldo H. Verdejo CVS syncmail at mplayerhq.hu
Fri Nov 5 22:44:23 CET 2004


CVS change done by Reynaldo H. Verdejo CVS

Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv1679

Modified Files:
	mplayer.c 
Log Message:
Replaces edl_mute_count with togle making code more understandable, other trivial list suggested changes too, Patch by Oded Shimon

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.806
retrieving revision 1.807
diff -u -r1.806 -r1.807
--- mplayer.c	3 Nov 2004 21:37:09 -0000	1.806
+++ mplayer.c	5 Nov 2004 21:44:20 -0000	1.807
@@ -361,9 +361,9 @@
 int edl_memory_slots = 0; ///< number of EDL entries (1 for skip + 2 for each mute)
 int edl_operations = 0; ///< number of EDL operations, skip + mute
 short user_muted = 0; ///< Stores whether User wanted muted mode.
+short edl_muted  = 0; ///< Stores whether EDL is currently in muted mode.
 short edl_decision = 0; ///< 1 when an EDL operation has been made
 FILE* edl_fd = NULL; ///< fd to write to when in -edlout mode
-int edl_mute_count = 0; ///< even number when mute and unmute has been matched
 #endif
 
 static unsigned int inited_flags=0;
@@ -2650,8 +2650,8 @@
        mp_msg(MSGT_CPLAYER, MSGL_DBG4, "EDL_SKIP: start [%f], stop [%f], length [%f]\n", next_edl_record->start_sec, next_edl_record->stop_sec, next_edl_record->length_sec );
        edl_decision = 1;
      } else if( next_edl_record->action == EDL_MUTE ) {
-       edl_mute_count++; // new EDL seek behavior needs this
-       if ((user_muted | (edl_mute_count & 1)) != mixer.muted) mixer_mute(&mixer);
+       edl_muted = !edl_muted;
+       if ((user_muted | edl_muted) != mixer.muted) mixer_mute(&mixer);
        mp_msg(MSGT_CPLAYER, MSGL_DBG4, "EDL_MUTE: [%f]\n", next_edl_record->start_sec );
      }
      next_edl_record=next_edl_record->next;
@@ -2845,7 +2845,7 @@
 		int abs = (cmd->nargs > 1) ? cmd->args[1].v.i : 0;
 		
 #ifdef USE_EDL
-      if (edl_mute_count & 1) break;
+      if (edl_muted) break;
       user_muted = 0;
 #endif
 		if( abs )
@@ -2871,8 +2871,8 @@
     } break;
     case MP_CMD_MUTE:
 #ifdef USE_EDL
-      user_muted = user_muted ? 0 : 1;
-      if (((edl_mute_count & 1) | user_muted) != mixer.muted)
+      user_muted = !user_muted;
+      if ((edl_muted | user_muted) != mixer.muted)
 #endif
       mixer_mute(&mixer);
       break;
@@ -3756,7 +3756,7 @@
  * and find the next EDL action to take care of.
  */
 
-edl_mute_count = 0;
+edl_muted = 0;
 next_edl_record = edl_records;
 
 while (next_edl_record)
@@ -3768,11 +3768,11 @@
     if (next_edl_record->start_sec >= sh_video->pts)
         break;
 
-    if (next_edl_record->action == EDL_MUTE) edl_mute_count++;
+    if (next_edl_record->action == EDL_MUTE) edl_muted = !edl_muted;
     next_edl_record = next_edl_record->next;
 
 }
-if ((user_muted | (edl_mute_count & 1)) != mixer.muted) mixer_mute(&mixer);
+if ((user_muted | edl_muted) != mixer.muted) mixer_mute(&mixer);
 #endif
   rel_seek_secs=0;
   abs_seek_pos=0;




More information about the MPlayer-cvslog mailing list