[MPlayer-cvslog] CVS: main/libmpdemux demux_asf.c,1.31,1.32

Reimar Döffinger CVS syncmail at mplayerhq.hu
Mon May 23 18:20:48 CEST 2005


CVS change done by Reimar Döffinger CVS

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

Modified Files:
	demux_asf.c 
Log Message:
Speedup asf descrambling (avoid one memcpy and use our fastmemcpy).


Index: demux_asf.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_asf.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- demux_asf.c	15 Jan 2005 16:11:44 -0000	1.31
+++ demux_asf.c	23 May 2005 16:20:46 -0000	1.32
@@ -12,6 +12,7 @@
 #include "asf.h"
 #include "demuxer.h"
 
+#include "../libvo/fastmemcpy.h"
 
 /*
  * Load 16/32-bit values in little endian byte order
@@ -40,9 +41,9 @@
 
 // based on asf file-format doc by Eugene [http://divx.euro.ru]
 
-static void asf_descrambling(unsigned char *src,int len){
+static void asf_descrambling(unsigned char **src,int len){
   unsigned char *dst=malloc(len);
-  unsigned char *s2=src;
+  unsigned char *s2=*src;
   int i=0,x,y;
   while(len-i>=asf_scrambling_h*asf_scrambling_w*asf_scrambling_b){
 //    mp_msg(MSGT_DEMUX,MSGL_DBG4,"descrambling! (w=%d  b=%d)\n",w,asf_scrambling_b);
@@ -55,8 +56,8 @@
 	s2+=asf_scrambling_h*asf_scrambling_w*asf_scrambling_b;
   }
   //if(i<len) memcpy(dst+i,src+i,len-i);
-  memcpy(src,dst,i);
-  free(dst);
+  free(*src);
+  *src = dst;
 }
 
 
@@ -96,7 +97,7 @@
         // closed segment, finalize packet:
 		if(ds==demux->audio)
 		  if(asf_scrambling_h>1 && asf_scrambling_w>1)
-		    asf_descrambling(ds->asf_packet->buffer,ds->asf_packet->len);
+		    asf_descrambling(&ds->asf_packet->buffer,ds->asf_packet->len);
         ds_add_packet(ds,ds->asf_packet);
         ds->asf_packet=NULL;
       } else {




More information about the MPlayer-cvslog mailing list