[Mplayer-cvslog] CVS: main/libmpcodecs ad_dvdpcm.c,1.5,1.6

Reimar Döffinger CVS syncmail at mplayerhq.hu
Fri Sep 3 12:50:05 CEST 2004


CVS change done by Reimar Döffinger CVS

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

Modified Files:
	ad_dvdpcm.c 
Log Message:
first attempt to make 24-bit PCM DVDs work


Index: ad_dvdpcm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_dvdpcm.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ad_dvdpcm.c	8 Oct 2002 22:56:43 -0000	1.5
+++ ad_dvdpcm.c	3 Sep 2004 10:50:03 -0000	1.6
@@ -4,6 +4,7 @@
 
 #include "config.h"
 #include "ad_internal.h"
+#include "../libaf/af_format.h"
 
 static ad_info_t info = 
 {
@@ -29,12 +30,28 @@
 	case 2: sh->samplerate=44100;break;
 	case 3: sh->samplerate=32000;break;
 	}
+	switch ((h >> 6) & 3) {
+	  case 0:
+	    sh->sample_format = AFMT_S16_BE;
+	    sh->samplesize = 2;
+	    break;
+	  case 2: 
+	    sh->sample_format = AFMT_AF_FLAGS | AF_FORMAT_I |
+	                         AF_FORMAT_BE | AF_FORMAT_US;
+	    sh->samplesize = 3;
+	    break;
+	  default:
+	    sh->sample_format = AFMT_S16_BE;
+	    sh->samplesize = 2;
+	}
     } else {
 	// use defaults:
 	sh->channels=2;
 	sh->samplerate=48000;
+	sh->sample_format = AFMT_S16_BE;
+	sh->samplesize = 2;
     }
-    sh->i_bps=2*sh->channels*sh->samplerate;
+    sh->i_bps = sh->samplesize * sh->channels * sh->samplerate;
     return 1;
 }
 
@@ -66,12 +83,5 @@
 {
   int j,len;
   len=demux_read_data(sh_audio->ds,buf,(minlen+3)&(~3));
-#ifndef WORDS_BIGENDIAN
-  for(j=0;j<len;j+=2){
-    char x=buf[j];
-    buf[j]=buf[j+1];
-    buf[j+1]=x;
-  }
-#endif
   return len;
 }




More information about the MPlayer-cvslog mailing list