[MPlayer-dev-eng] [PATCH] edl mute/unmute must be grouped

Reynaldo H. Verdejo Pinochet reynaldo at opendot.cl
Thu Aug 19 09:24:31 CEST 2004


mute operations on edl uses 2 slots on the edl_records array,
one of the entries mute the sound, next unmute it, if you
have a MUTE desission when: 
(mute desissions * 2 + skip desissions ) -1 == MAX_EDL_ENTRIES
unmute never gets called, so you are left without sound, suppose
no one spot the bug earlier coz on edl.h MAX_EDL_ENTRIES = 1000,
if you change that value to, lets say '6', problem can be easily
reproduced.

grouping mute/unmute operations on a single block when we have 
_enough_ room to store the two afore mentioned records, solve
the problem.

btw, I will be trying to implement edl on mencoder.

Best regards

  Reynaldo


-------------- next part --------------
--- mplayer.c	2004-08-19 02:48:01.000000000 -0400
+++ ../my_main/mplayer.c	2004-08-19 03:07:35.000000000 -0400
@@ -990,18 +990,17 @@
 	   }
 	   edl_records[ next_edl_array_index ].action = action;
 	   if( action == EDL_MUTE ) {
+	    if( next_edl_array_index  < MAX_EDL_ENTRIES - 1 ) {
 	     edl_records[ next_edl_array_index ].length_sec = 0;
 	     edl_records[ next_edl_array_index ].start_sec = start;
 	     edl_records[ next_edl_array_index ].stop_sec = start;
 	     next_edl_array_index++;
-	     if( next_edl_array_index >= MAX_EDL_ENTRIES-1 ) {
-	       break;
-	     }
 	     edl_records[ next_edl_array_index-1 ].next = &edl_records[ next_edl_array_index ];
 	     edl_records[ next_edl_array_index ].action = EDL_MUTE;
 	     edl_records[ next_edl_array_index ].length_sec = 0;
 	     edl_records[ next_edl_array_index ].start_sec = stop;
 	     edl_records[ next_edl_array_index ].stop_sec = stop;
+        }
 	   } else {
 	     edl_records[ next_edl_array_index ].length_sec = stop - start;
 	     edl_records[ next_edl_array_index ].start_sec = start;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20040819/82c92930/attachment.pgp>


More information about the MPlayer-dev-eng mailing list