[Mplayer-cvslog] CVS: main mplayer.c,1.804,1.805

Reynaldo H. Verdejo CVS syncmail at mplayerhq.hu
Wed Nov 3 21:48:22 CET 2004


CVS change done by Reynaldo H. Verdejo CVS

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

Modified Files:
	mplayer.c 
Log Message:
Fix EDL mute behavior, Patch by Oded Shimon

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.804
retrieving revision 1.805
diff -u -r1.804 -r1.805
--- mplayer.c	3 Nov 2004 00:08:03 -0000	1.804
+++ mplayer.c	3 Nov 2004 20:48:19 -0000	1.805
@@ -360,6 +360,7 @@
 edl_record_ptr next_edl_record = NULL; ///< only for traversing edl_records
 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_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
@@ -2647,10 +2648,9 @@
        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 ) {
-       mixer_mute(&mixer);
        edl_mute_count++; // new EDL seek behavior needs this
+       if ((user_muted | (edl_mute_count & 1)) != mixer.muted) mixer_mute(&mixer);
        mp_msg(MSGT_CPLAYER, MSGL_DBG4, "EDL_MUTE: [%f]\n", next_edl_record->start_sec );
-       edl_decision = 1;
      }
      next_edl_record=next_edl_record->next;
    }
@@ -2842,6 +2842,10 @@
 		// start change for absolute volume value
 		int abs = (cmd->nargs > 1) ? cmd->args[1].v.i : 0;
 		
+#ifdef USE_EDL
+      if (edl_mute_count & 1) break;
+      user_muted = 0;
+#endif
 		if( abs )
 		{
 			mixer_setvolume(&mixer, (float)v, (float)v );
@@ -2864,6 +2868,10 @@
 #endif
     } break;
     case MP_CMD_MUTE:
+#ifdef USE_EDL
+      user_muted = user_muted ? 0 : 1;
+      if (((edl_mute_count & 1) | user_muted) != mixer.muted)
+#endif
       mixer_mute(&mixer);
       break;
     case MP_CMD_LOADFILE : {
@@ -3746,6 +3754,7 @@
  * and find the next EDL action to take care of.
  */
 
+edl_mute_count = 0;
 next_edl_record = edl_records;
 
 while (next_edl_record)
@@ -3755,38 +3764,13 @@
      */
   
     if (next_edl_record->start_sec >= sh_video->pts)
-    {
-        if (edl_mute_count > 0)
-        {
-            if ((edl_mute_count % 2) == 0 &&
-                next_edl_record->mute_state == EDL_MUTE_END)
-            {
-                mixer_mute(&mixer);
-                edl_mute_count++;
-            }
-            if ((edl_mute_count % 2) != 0 &&
-                next_edl_record->mute_state == EDL_MUTE_START)
-            {
-                mixer_mute(&mixer);
-                edl_mute_count++;
-            }
-        } else if (next_edl_record->mute_state == EDL_MUTE_END)
-        {
-            mixer_mute(&mixer);
-            edl_mute_count++;
-        }
         break;
-    }
 
+    if (next_edl_record->action == EDL_MUTE) edl_mute_count++;
     next_edl_record = next_edl_record->next;
 
-    if (!next_edl_record && (edl_mute_count % 2) != 0
-        && edl_mute_count > 0)
-    {
-        mixer_mute(&mixer);
-        edl_mute_count++;
-    }
 }
+if ((user_muted | (edl_mute_count & 1)) != mixer.muted) mixer_mute(&mixer);
 #endif
   rel_seek_secs=0;
   abs_seek_pos=0;




More information about the MPlayer-cvslog mailing list