changeset 17858:996e419c1671

in24/in32/fl32 little/big-endian QuickTime PCM audio support approved by rxt
author rathann
date Mon, 13 Mar 2006 23:32:36 +0000
parents 115a8e901106
children 4d863533f100
files etc/codecs.conf libmpcodecs/ad_pcm.c libmpdemux/demux_mov.c
diffstat 3 files changed, 44 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/etc/codecs.conf	Mon Mar 13 21:50:56 2006 +0000
+++ b/etc/codecs.conf	Mon Mar 13 23:32:36 2006 +0000
@@ -2362,9 +2362,14 @@
   format 0x736f7774  ; "twos" (MOV files)
   format 0x74776f73  ; "sowt" (MOV files)
   format 0x32336c66  ; "fl32" (MOV files)
+  format 0x666c3332  ; "23lf" (MOV files)
+;  format 0x34366c66  ; "fl64" (MOV files)
+;  format 0x666c3634  ; "46lf" (MOV files)
   format 0x454e4f4e  ; "NONE" (MOV files from Kodak CX6320)
   format 0x34326e69  ; "in24" (MOV files)
+  format 0x696e3234  ; "42ni" (MOV files)
   format 0x32336e69  ; "in32" (MOV files)
+  format 0x696e3332  ; "23ni" (MOV files)
 ;;;; these are for hardware support only:  (alaw,ulaw,ima-adpcm,mpeg,ac3)
 ;  format 0x6
 ;  format 0x7
--- a/libmpcodecs/ad_pcm.c	Mon Mar 13 21:50:56 2006 +0000
+++ b/libmpcodecs/ad_pcm.c	Mon Mar 13 23:32:36 2006 +0000
@@ -65,14 +65,34 @@
        sh_audio->sample_format=AF_FORMAT_FLOAT_BE;
        sh_audio->samplesize=4;
        break;
+    case 0x666c3332: // '23lf', little endian float32, MPlayer internal fourCC
+       sh_audio->sample_format=AF_FORMAT_FLOAT_LE;
+       sh_audio->samplesize=4;
+       break;
+/*    case 0x34366c66: // 'fl64', bigendian float64
+       sh_audio->sample_format=AF_FORMAT_FLOAT_BE;
+       sh_audio->samplesize=8;
+       break;
+    case 0x666c3634: // '46lf', little endian float64, MPlayer internal fourCC
+       sh_audio->sample_format=AF_FORMAT_FLOAT_LE;
+       sh_audio->samplesize=8;
+       break;*/
     case 0x34326e69: // 'in24', bigendian int24
        sh_audio->sample_format=AF_FORMAT_S24_BE;
        sh_audio->samplesize=3;
        break;
+    case 0x696e3234: // '42ni', little endian int24, MPlayer internal fourCC
+       sh_audio->sample_format=AF_FORMAT_S24_LE;
+       sh_audio->samplesize=3;
+       break;
     case 0x32336e69: // 'in32', bigendian int32
        sh_audio->sample_format=AF_FORMAT_S32_BE;
        sh_audio->samplesize=4;
        break;
+    case 0x696e3332: // '23ni', little endian int32, MPlayer internal fourCC
+       sh_audio->sample_format=AF_FORMAT_S32_LE;
+       sh_audio->samplesize=4;
+       break;
     default: if(sh_audio->samplesize!=2) sh_audio->sample_format=AF_FORMAT_U8;
   }
   if (!sh_audio->samplesize) // this would cause MPlayer to hang later
--- a/libmpdemux/demux_mov.c	Mon Mar 13 21:50:56 2006 +0000
+++ b/libmpdemux/demux_mov.c	Mon Mar 13 23:32:36 2006 +0000
@@ -724,13 +724,29 @@
 		    mp_msg(MSGT_DEMUX,MSGL_V,"Audio extra header: len=%d  fcc=0x%X\n",len,fcc);
 		    if((len >= 4) && 
 		       (char2int(trak->stdata,52) >= 12) &&
-		       (char2int(trak->stdata,52+4) == MOV_FOURCC('f','r','m','a')) &&
-		       (char2int(trak->stdata,52+8) == MOV_FOURCC('a','l','a','c')) &&
-		       (len >= 36 + char2int(trak->stdata,52))) {
+		       (char2int(trak->stdata,52+4) == MOV_FOURCC('f','r','m','a'))) {
+			switch(char2int(trak->stdata,52+8)) {
+			 case MOV_FOURCC('a','l','a','c'):
+			  if (len >= 36 + char2int(trak->stdata,52)) {
 			    sh->codecdata_len = char2int(trak->stdata,52+char2int(trak->stdata,52));
 			    mp_msg(MSGT_DEMUX, MSGL_V, "MOV: Found alac atom (%d)!\n", sh->codecdata_len);
 			    sh->codecdata = (unsigned char *)malloc(sh->codecdata_len);
 			    memcpy(sh->codecdata, &trak->stdata[52+char2int(trak->stdata,52)], sh->codecdata_len);
+			  }
+			  break;
+			 case MOV_FOURCC('i','n','2','4'):
+			 case MOV_FOURCC('i','n','3','2'):
+			 case MOV_FOURCC('f','l','3','2'):
+			 case MOV_FOURCC('f','l','6','4'):
+			  if ((len >= 22) &&
+			      (char2int(trak->stdata,52+16)==MOV_FOURCC('e','n','d','a')) &&
+			      (char2short(trak->stdata,52+20))) {
+				sh->format=le2me_32(char2int(trak->stdata,52+8));
+				mp_msg(MSGT_DEMUX, MSGL_V, "MOV: Found little endian PCM data, reversed fourcc:%04x\n", sh->format);
+			  }
+		          break;
+		         default: break;
+		        }
 		    } else {
 		      if (len > 8 && len + 44 <= trak->stdata_len) {
 		    sh->codecdata_len = len-8;